UNPKG

n-digit-token

Version:

Cryptographically secure pseudo-random token of n digits

11 lines (10 loc) 475 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateSecureToken = void 0; const library_1 = require("./library"); exports.generateSecureToken = ((length, options) => { (0, library_1.validateLength)(length); (0, library_1.validateOptions)(length, options); const secureBigIntToken = (0, library_1.generateWithoutModuloBias)(length, options); return (0, library_1.handleOptions)(secureBigIntToken, length, options); });