Code example for MessageDigest

Methods: digestresetupdate

0
        init(); 
        if (md5 == null) {
            return null; 
        } 
 
        md5.reset();
        md5.update(data);
 
        byte[] md = md5.digest();
 
        long ret = (fixByte(md[0]) | (fixByte(md[1]) << 8L));
        ret = ret | fixByte(md[2]) << 16L;
        ret = ret | fixByte(md[3]) << 24L;
        ret = ret & 0xffffffffL;
 
        return Long.toHexString(ret);
    } 
 
    private static long fixByte(byte b) {
        return (b < 0) ? (long) (b + 256) : (long) b;