Java Hex to String convertHexString(String ss)

Here you can find the source of convertHexString(String ss)

Description

convert Hex String

License

Apache License

Declaration

public static byte[] convertHexString(String ss) 

Method Source Code

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

public class Main {
    public static byte[] convertHexString(String ss) {
        byte digest[] = new byte[ss.length() / 2];
        for (int i = 0; i < digest.length; i++) {
            String byteString = ss.substring(2 * i, 2 * i + 2);
            int byteValue = Integer.parseInt(byteString, 16);
            digest[i] = (byte) byteValue;
        }//from  w w  w.ja  va2s.c  o m
        return digest;
    }
}

Related

  1. convertHexStr(String inStr)
  2. convertHexStringToString(String hexString)
  3. convertHexToString(String hex)
  4. formatHex(byte[] buf)
  5. formatHex(byte[] data)