public class Modhex
extends java.lang.Object
Utility methods to
encode
a byte array to Modhex
String
and to
decode
a Modhex
String
to a the byte array it represents.
Modehex encoding uses the
alphabet
cbdefghijklnrtuv
which has the property
of being at the same position on all keyboards.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALPHABET
The Modhex alphabet: the letters used to decode bytes in.
|
public static final java.lang.String ALPHABET
The Modhex alphabet: the letters used to decode bytes in.
public static java.lang.String encode(byte[] data)
Encodes.
data
- Data to encode.public static byte[] decode(java.lang.String s)
Decodes.
s
- Modhex encoded
String
. Decoding ignores case of s
.s
represents.java.lang.IllegalArgumentException
- If s
not valid Modhex.