How to get hash of message
Posted: Mon Oct 17, 2016 11:14 pm
I tried to use MessageDigest to get hash. it always returned 6F 00. I guess MessageDigest.getInstance caused the problem, but I'm not sure. ANY HELP? tHANKS!
My sectional code:
My sectional code:
Code: Select all
private void getDigest(byte[] buffer)
{
if (hashArray == null)
hashArray = JCSystem.makeTransientByteArray((short)20, JCSystem.CLEAR_ON_DESELECT);
MessageDigest alg = MessageDigest.getInstance(MessageDigest.ALG_SHA,true);// If I comment this line, the applet can run w/o any problem.
}