code: public static String toHex(byte[] bytes) {
      StringBuffer buffer = new StringBuffer();
  
      for (byte b : bytes) {
        buffer.append(String.format("%02X", b));
      }
  
      return buffer.toString();
    }
docs: Returns a hexadecimal {@link String} representation of
  a given @{code byte} array. Primarily used for debug
  logging.
  
  @param bytes The byte array to convert.
  @return The hexadecimal representation as a {@linkplain String}.