Actually I'm trying to use TOTP in my app and google authenticator requires the key to be in base32 format. This is the reason I'm trying to convert a key to base32 format
Let's say I have a number = 150820200825235.
This wikipedia page says that RFC-4648 is the most common base32 alphabet used.
Here's my java code where I'm trying to convert a number to base 32:
long key=150820200825235L;
String base32Key = Long.toString(key,32);
System.out.println(base32Key);
Now it is printing this as the output :
495e87tgcj
It contains 9 which is invalid according to RFC-4648.
how do I convert to base32 number as per RFC-4648 in java?
One more thing If the most widely used Base32 alphabet is really as per RFC-4648 then why doesn't java support it as default? or is something is wrong in my understanding/code ?