If you use MessageDigest in java to encrypt string, you wont get hash like other language does. So you need to convert the result so that you can compare the hash result with other output that produce by diff language. Found the function on the java net forum private static String baToHexString(byte byteValues[]) { byte singleChar = 0; if (byteValues == null || byteValues.length String entries[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; StringBuffer out = new StringBuffer(byteValues.length * 2); for (int i = 0; i singleChar = (byte) (byteValues[i] & 0xF0); singleChar = (byte) (singleChar >>> 4); // shift the bits down singleChar = (byte...
Comments