Java Hex Calculate toHex(byte[] v)

Here you can find the source of toHex(byte[] v)

Description

to Hex

License

Open Source License

Declaration

public final static String toHex(byte[] v) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static char[] hex = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };

    public final static String toHex(byte[] v) {
        String out = "";
        for (int i = 0; i < v.length; i++)
            out = out + hex[(v[i] >> 4) & 0xF] + hex[v[i] & 0xF];
        return (out);
    }// w ww.  ja v a2s  . c  o m
}

Related

  1. toHex(byte[] raw)
  2. toHex(byte[] raw)
  3. ToHex(byte[] src)
  4. toHex(byte[] src)
  5. toHex(byte[] text)
  6. toHex(byte[] val)
  7. toHex(byte[] val, int start, int len)
  8. toHex(byte[] value)
  9. toHex(byte[] value)