All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.scalecube.utils.HexUtil Maven / Gradle / Ivy

The newest version!
package io.scalecube.utils;

public final class HexUtil {

  private HexUtil() {
    // Do not instantiate
  }

  /**
   * Converts bytes array to hex string.
   *
   * @param bytes bytes array
   * @return hex string
   */
  public static String toHex(byte[] bytes) {
    StringBuilder sb = new StringBuilder();
    for (byte b : bytes) {
      sb.append(String.format("%02x", b));
    }
    return sb.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy