Generates a random base32-encoded secret suitable for both HOTP and TOTP.
Each character carries 5 bits of entropy. byte % 32 is unbiased because 256 is an exact multiple of 32, so no character of the alphabet is favoured.
byte % 32
Number of characters in the generated secret.
The base32-encoded secret.
Generates a random base32-encoded secret suitable for both HOTP and TOTP.
Each character carries 5 bits of entropy.
byte % 32is unbiased because 256 is an exact multiple of 32, so no character of the alphabet is favoured.