Beispiel #1
0
 /*
  * Helper
  */
 private static String doDigestForByteArray(final byte[] bytes, final String algorithm) {
   try {
     MessageDigest md = MessageDigest.getInstance(algorithm);
     byte[] hash = md.digest(bytes);
     return HexUtil.toString(hash);
   } catch (NoSuchAlgorithmException e) {
     e.printStackTrace();
     return null;
   }
 }
Beispiel #2
0
 // Log util
 public static String toString_Hex0xAndDec(int word) {
   return HexUtil.toHexString0x(word) + " (" + (word & 0xFFFF) + ")";
 }