|
aerogear-crypto 0.1.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.aerogear.crypto.encoders.Hex
public class Hex
Converts hexadecimal Strings.
This class is thread-safe. This class contains code from the Apache Common-Codec project
| Field Summary | |
|---|---|
private static char[] |
DIGITS_LOWER
Used to build output as Hex |
private static char[] |
DIGITS_UPPER
Used to build output as Hex |
| Fields inherited from interface org.jboss.aerogear.crypto.encoders.Encoder |
|---|
BASE64, CHARSET, HEX, RAW |
| Constructor Summary | |
|---|---|
Hex()
|
|
| Method Summary | |
|---|---|
byte[] |
decode(String value)
Decode a provided string to bytes |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final char[] DIGITS_LOWER
private static final char[] DIGITS_UPPER
| Constructor Detail |
|---|
public Hex()
| Method Detail |
|---|
private static byte[] decodeHex(char[] data)
data - An array of characters containing hexadecimal digits
public byte[] decode(String value)
Encoder
decode in interface Encodervalue - to be decoded
private static char[] encodeHex(byte[] data)
data - a byte[] to convert to Hex characters
private static char[] encodeHex(byte[] data,
boolean toLowerCase)
data - a byte[] to convert to Hex characterstoLowerCase - true converts to lowercase, false to uppercase
private static char[] encodeHex(byte[] data,
char[] toDigits)
data - a byte[] to convert to Hex characterstoDigits - the output alphabet
public String encode(byte[] data)
encode in interface Encoderdata - a byte[] to convert to Hex characters
private static int toDigit(char ch,
int index)
ch - A character to convert to an integer digitindex - The index of the character in the source
public String toString()
toString in class Object
|
aerogear-crypto 0.1.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||