UNPKG

n-digit-token

Version:

Cryptographically secure pseudo-random token of n digits

13 lines (12 loc) 491 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.calculateByteSize = void 0; const constants_1 = require("./constants"); /** * Calculate total size of byte stream to be generated. * @param {number} length * @param {Options} [options] * @return {number} required number of bytes */ const calculateByteSize = (length, options) => options && options.customMemory || constants_1.DEFAULT_BYTE_SIZE + length; exports.calculateByteSize = calculateByteSize;