Secret generation and Base32 encoding
Generating a key means producing random bytes in the browser and encoding them in Base32, the alphabet authenticator apps expect: A-Z plus 2-7. The usual default size is 160 bits, which encodes to exactly 32 characters with no padding - the same size as the shared secret in RFC 6238's test vectors. You can copy the string or scan the QR; both carry the same secret.