* Validate if a secret key is in valid Base32 format * @param secret The secret key to validate * @returns boolean indicating if the secret is valid
(secret: string)
| 21 | * @returns boolean indicating if the secret is valid |
| 22 | */ |
| 23 | public static isValidSecret(secret: string): boolean { |
| 24 | const base32Regex = /^[A-Z2-7]+=*$/ |
| 25 | return base32Regex.test(secret.toUpperCase()) |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Generate TOTP at a specific counter value |
nothing calls this directly
no outgoing calls
no test coverage detected