Compute Hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get the hash's bytes | |
byte[] bytes = digest.digest(); | |
//This bytes[] has bytes in decimal format; | |
//Convert it to hexadecimal format | |
StringBuilder sb = new StringBuilder(); | |
for(int i=0; i< bytes.length ;i++) | |
{ | |
sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1)); | |
} | |
//return complete hash | |
return sb.toString(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment