Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1.     public static String hashToString(byte[] hash) {
  2.         StringBuffer hexString = new StringBuffer();
  3.         for (int i = 0; i < hash.length; i++)
  4.         {
  5.             String hex = Integer.toHexString(0xFF & hash[i]);
  6.             if (hex.length() == 1)
  7.             {
  8.                 hexString.append('0');
  9.             }
  10.             hexString.append(hex);
  11.         }
  12.         return hexString.toString();
  13.     }
Add Comment
Please, Sign In to add comment