`otpsecret` from `totp` to support customized size
Closed this issue · 1 comments
imcotton commented
e.g.
export function otpsecret(n = 20): string {
return encodeBase32(crypto.getRandomValues(new Uint8Array(n))).replaceAll("=", "")
}
This is backwards compatible addition, any thoughts?
lowlighter commented
Yes I don't think there's any restriction about the secret length according to: https://github.com/google/google-authenticator/wiki/Key-Uri-Format#secret so we could allow a customized size