Class Base32
java.lang.Object
com.irurueta.authserver.authorization.domain.totp.Base32
Base32 encoding (RFC 4648) without padding, the form authenticator applications expect for a shared secret.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe Base32 alphabet.private static final intBits carried by each byte.private static final intBits carried by each character.private static final intMask selecting the bits of one byte, to read it as unsigned.private static final intMask selecting the bits of one character. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ALPHABET
The Base32 alphabet.- See Also:
-
BITS_PER_BYTE
private static final int BITS_PER_BYTEBits carried by each byte.- See Also:
-
BITS_PER_CHAR
private static final int BITS_PER_CHARBits carried by each character.- See Also:
-
BYTE_MASK
private static final int BYTE_MASKMask selecting the bits of one byte, to read it as unsigned.- See Also:
-
CHAR_MASK
private static final int CHAR_MASKMask selecting the bits of one character.- See Also:
-
-
Constructor Details
-
Base32
private Base32()Not instantiable: a holder of static helpers.
-
-
Method Details
-
encode
Encodes bytes.- Parameters:
data- the bytes to encode; must not benull.- Returns:
- the encoded text, upper case and without padding.
-