Java Byte Array to String bytetoString(byte[] digest)

Here you can find the source of bytetoString(byte[] digest)

Description

byteto String

License

Apache License

Declaration

public static String bytetoString(byte[] digest) 

Method Source Code

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

public class Main {
    public static String bytetoString(byte[] digest) {
        String str = "";
        String tempStr = "";

        for (int i = 0; i < digest.length; i++) {
            tempStr = (Integer.toHexString(digest[i] & 0xff));
            if (tempStr.length() == 1) {
                str = str + "0" + tempStr;
            } else {
                str = str + tempStr;/*from  w  ww.ja  v a2  s  .  c  o  m*/
            }
        }
        return str.toLowerCase();
    }
}

Related

  1. byteToString(byte[] bByte)
  2. byteToString(byte[] byteArr)
  3. byteToString(byte[] bytearray)
  4. byteToString(byte[] bytes)
  5. byteToString(byte[] data)
  6. byteToString(byte[] input)
  7. bytetoString(byte[] tb)
  8. byteToString(final boolean prettyPrint, int byteValue)
  9. byteToString(int[] byteData)