org.abstractj.kalium.encoders
Modifier and Type | Field and Description |
---|---|
private static char[] |
DIGITS_LOWER
Used to build output as Hex
|
private static char[] |
DIGITS_UPPER
Used to build output as Hex
|
Constructor and Description |
---|
Hex() |
Modifier and Type | Method and Description |
---|---|
byte[] |
decode(String value) |
private static byte[] |
decodeHex(char[] data)
Converts an array of characters representing hexadecimal values into an array of bytes of those same values.
|
String |
encode(byte[] data)
Converts an array of bytes into a String representing the hexadecimal values of each byte in order.
|
private static char[] |
encodeHex(byte[] data)
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
|
private 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.
|
private 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.
|
private static int |
toDigit(char ch,
int index)
Converts a hexadecimal character to an integer.
|
String |
toString()
Returns a string representation of the object, which includes the charset name.
|
private static final char[] DIGITS_LOWER
private static final char[] DIGITS_UPPER
private static byte[] decodeHex(char[] data)
data
- An array of characters containing hexadecimal digitsprivate static char[] encodeHex(byte[] data)
data
- a byte[] to convert to Hex charactersprivate static char[] encodeHex(byte[] data, boolean toLowerCase)
data
- a byte[] to convert to Hex characterstoLowerCase
- true
converts to lowercase, false
to uppercaseprivate static char[] encodeHex(byte[] data, char[] toDigits)
data
- a byte[] to convert to Hex characterstoDigits
- the output alphabetpublic String encode(byte[] data)
private static int toDigit(char ch, int index)
ch
- A character to convert to an integer digitindex
- The index of the character in the sourceCopyright © 2015. All Rights Reserved.