public class Hex
extends java.lang.Object
Constructor and Description |
---|
Hex() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeHex(char[] data) |
static byte[] |
decodeHex(java.lang.String data) |
static char[] |
encodeHex(byte[] data)
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
|
static char[] |
encodeHex(byte[] data,
boolean toLowerCase)
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
|
protected static char[] |
encodeHex(byte[] data,
char[] toDigits)
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
|
static java.lang.String |
encodeHexString(byte[] data)
Converts an array of bytes into a String representing the hexadecimal values of each byte in order.
|
protected static int |
toDigit(char ch,
int index) |
public static char[] encodeHex(byte[] data)
data
- a byte[] to convert to Hex characterspublic static char[] encodeHex(byte[] data, boolean toLowerCase)
data
- a byte[] to convert to Hex characterstoLowerCase
- true
converts to lowercase, false
to uppercaseprotected static char[] encodeHex(byte[] data, char[] toDigits)
data
- a byte[] to convert to Hex characterstoDigits
- the output alphabetpublic static java.lang.String encodeHexString(byte[] data)
data
- a byte[] to convert to Hex characterspublic static byte[] decodeHex(java.lang.String data) throws org.elasticsearch.ElasticsearchIllegalStateException
org.elasticsearch.ElasticsearchIllegalStateException
public static byte[] decodeHex(char[] data) throws org.elasticsearch.ElasticsearchIllegalStateException
org.elasticsearch.ElasticsearchIllegalStateException
protected static int toDigit(char ch, int index) throws org.elasticsearch.ElasticsearchIllegalStateException
org.elasticsearch.ElasticsearchIllegalStateException