Skip to content

Function: nonceString() ​

nonceString(): string

Generate a nonce: a random string of 32 letters and digits ([A-Za-z0-9]), drawn from the cryptographic random generator. It is randomString(32, 'alphanumeric').

Returns ​

string

A new 32-character string at each call.

Example ​

typescript
import {nonceString} from 'lakutata/utils'

const nonce: string = nonceString()
console.log(nonce.length)
//32

Released under the MIT License.