code: private static String byte2hex(byte[] bytes) {
          char[] hexChars =
                  {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b',
                          'c', 'd', 'e', 'f'};
  
          StringBuffer sb = new StringBuffer();
          for (byte b : bytes) {
              sb.append(hexChars[b >> 4 & 0xf]);
              sb.append(hexChars[b & 0xf]);
          }
  
          return new String(sb);
      }
docs: Converts a hash into its hexadecimal string representation.
  
  @param bytes
  the byte array to convert
  @return the hexadecimal string representation