I changed the code a bit, but it seems to work, when i use digest outside the try catch, can't explain why, unless its the update change that fixed it.
public static byte[] createChecksum(byte[] b){
MessageDigest md = null;
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
md.update(b,0,b.length);
byte[] checksum = md.digest();
return checksum;
}