Java Byte Array to Hex bytesToHex(byte[] data, char[] chars)

Here you can find the source of bytesToHex(byte[] data, char[] chars)

Description

bytes To Hex

License

Apache License

Declaration

public static String bytesToHex(byte[] data, char[] chars) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String bytesToHex(byte[] data, char[] chars) {

        int length = data.length;
        char[] out = new char[length << 1];

        for (int i = 0, j = 0; i < length; i++) {
            out[j++] = chars[(0xF0 & data[i]) >>> 4];
            out[j++] = chars[0x0F & data[i]];
        }/*  w w w . ja  va 2 s .  c om*/
        return new String(out);
    }
}

Related

  1. bytesToHex(byte[] data)
  2. bytesToHex(byte[] data)
  3. bytesToHex(byte[] data)
  4. bytesToHex(byte[] data)
  5. bytesToHex(byte[] data)
  6. bytesToHex(byte[] data, int m, int n)
  7. bytesToHex(byte[] digest)
  8. bytesToHex(byte[] in)
  9. bytesToHex(byte[] raw)