Package tech.mgl.utils.security.gen
Class Base32String
java.lang.Object
tech.mgl.utils.security.gen.Base32String
Encodes arbitrary byte arrays as case-insensitive base-32 strings.
The implementation is slightly different than in RFC 4648. During encoding, padding is not added, and during decoding the last incomplete chunk is not taken into account. The result is that multiple strings decode to the same byte array, for example, string of sixteen 7s ("7...7") and seventeen 7s both decode to the same byte array. TODO(sarvar): Revisit this encoding and whether this ambiguity needs fixing.
- Author:
- sweis@google.com (Steve Weis), Neal Gafter
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static byte[]protected byte[]decodeInternal(String encoded) static Stringencode(byte[] data) protected StringencodeInternal(byte[] data)
-
Constructor Details
-
Base32String
-
-
Method Details
-
decode
- Throws:
Base32String.DecodingException
-
decodeInternal
- Throws:
Base32String.DecodingException
-
encode
-
encodeInternal
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-