Replace Function key32gen() with generateTotpSecret()

This commit is contained in:
johnnyq
2026-07-14 17:27:02 -04:00
parent b57ddc0e5c
commit 8de3cd300d
3 changed files with 4 additions and 4 deletions

View File

@@ -14,8 +14,8 @@ function randomString(int $length = 16): string {
);
}
// Used only for TOTP
function key32gen() {
// Generate a cryptographically secure 32-char base32 secret for TOTP
function generateTotpSecret() {
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
$key = '';
for ($i = 0; $i < 32; $i++) {