Package at.favre.lib.idmask
Interface ByteToTextEncoding
-
- All Known Implementing Classes:
ByteToTextEncoding.Base16
,ByteToTextEncoding.Base32Rfc4648
,ByteToTextEncoding.Base64Url
,ByteToTextEncoding.BaseMod8Encoding
,ByteToTextEncoding.CleanBase32Encoding
,ByteToTextEncoding.IdFormatter
public interface ByteToTextEncoding
Responsible for encoding byte arrays to ASCII safe text and vice versa. More precisely, it is an encoding of binary data in a sequence of printable characters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ByteToTextEncoding.Base16
Hexadecimal (also base 16, or hex) is a positional numeral system with a radix, or base, of 16.static class
ByteToTextEncoding.Base32Rfc4648
Base32Rfc4648 uses a 32-character set comprising the twenty-six upper-case letters A–Z, and the digits 2–7.static class
ByteToTextEncoding.Base64Url
RFC 4648 compatible Base64 encoding with url safe schema.static class
ByteToTextEncoding.BaseMod8Encoding
Base encoding with alphabet of length 2^x (16, 32, 64, etc.)static class
ByteToTextEncoding.CleanBase32Encoding
Base32 encoding dialect with some letters removed so to omit the accidental creation of english curse words.static class
ByteToTextEncoding.IdFormatter
ID formatting decorator.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
decode(CharSequence encoded)
Decode given encoded string (seeencode(byte[])
to a byte arrayString
encode(byte[] bytes)
Encode given byte array to printable text
-
-
-
Method Detail
-
encode
String encode(byte[] bytes)
Encode given byte array to printable text- Parameters:
bytes
- to mask- Returns:
- printable text
-
decode
byte[] decode(CharSequence encoded)
Decode given encoded string (seeencode(byte[])
to a byte array- Parameters:
encoded
- text to unmask- Returns:
- raw bytes as array
-
-