Class Base32
java.lang.Object
com.codename1.security.Base32
public final class Base32
extends java.lang.Object
Base32 encoder/decoder per RFC 4648. Mostly useful for OTP shared secrets, which are conventionally distributed as Base32 strings (the format embedded in QR codes by authenticator apps).
Example
byte[] secret = Base32.decode("JBSWY3DPEHPK3PXP");
String enc = Base32.encode(secret);
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
encode
Encodes the bytes as a Base32 string (uppercase, with=padding). -
decode
Decodes a Base32 string. Padding and whitespace are tolerated; mixed case is accepted.
-