chore(generate.util.ts): add documentation for generateRandomString32 function

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Yau 2025-11-10 15:31:43 +08:00 committed by GitHub
parent 700c977659
commit c30305ee5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,9 @@
import { randomBytes } from 'crypto' import { randomBytes } from 'crypto'
/**
* Generates a cryptographically secure 32-byte random string, returned as a 64-character hex string.
* @returns {string} A 64-character hexadecimal string.
*/
export function generateRandomString32(): string { export function generateRandomString32(): string {
return randomBytes(32).toString('hex') return randomBytes(32).toString('hex')
} }