// Path: ESignCore/src/main/java/tr/gov/turkiye/esign/support/Util.java
// final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();


import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CodingErrorAction;
import static tr.gov.turkiye.esign.support.Util.hexArray;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tr.gov.turkiye.esign.support;


/**
 *
 * @author iakpolat
 */
public class StringSupport {
    /**
     * @param bytes
     * @return hex representation of bytes
     */
    public static String bytesToHex(byte[] bytes) {
        char[] hexChars = new char[bytes.length * 2];
        for (int j = 0; j < bytes.length; j++) {
            int v = bytes[j] & 0xFF;
// Path: ESignCore/src/main/java/tr/gov/turkiye/esign/support/Util.java
// final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();


// Path: ESignCore/src/main/java/tr/gov/turkiye/esign/support/StringSupport.java
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CodingErrorAction;
import static tr.gov.turkiye.esign.support.Util.hexArray;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tr.gov.turkiye.esign.support;


/**
 *
 * @author iakpolat
 */
public class StringSupport {
    /**
     * @param bytes
     * @return hex representation of bytes
     */
    public static String bytesToHex(byte[] bytes) {
        char[] hexChars = new char[bytes.length * 2];
        for (int j = 0; j < bytes.length; j++) {
            int v = bytes[j] & 0xFF;
            hexChars[j * 2] = hexArray[v >>> 4];