folks how can i calculate md5 as integer.. we get it as Hex String. or byte[].. but how as string.. and when i talk about integer, i mean "int" i-e a small enough value to be accomodated easily in int.. here is my code
MessageDigest md = null;
try {
md = MessageDigest.getInstance("MD5");
}
catch(Exception e) {
e.printStackTrace();
}
byte [] md5Sum = new byte[32];
md.update(buffer,start,end);
md5Sum = md.digest();
for(int i = 0;i < md5Sum.length; i++) {
System.out.println(md5Sum);
}
return Math.abs(byteArrayToInt(md5Sum, 0)); // still is problamatic.. how to convert byte[] to int is my question
i have tried BigInt.intvalue() but it also works only for some cases ??