contingent
Version:
Create cryptographically-strong random numbers in node.js or the browser
42 lines (41 loc) • 1.2 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("./core");
const browser_lib_1 = __importDefault(require("./browser-lib"));
const { randomBytes: _randomBytes, randomBit, randomByte, randomInt, randomUInt, randomFloat, randomIn, randomOf, roll, shuffle, pick, select, replace, generate, } = core_1.core(browser_lib_1.default);
exports.randomBit = randomBit;
exports.randomByte = randomByte;
exports.randomInt = randomInt;
exports.randomUInt = randomUInt;
exports.randomFloat = randomFloat;
exports.randomIn = randomIn;
exports.randomOf = randomOf;
exports.roll = roll;
exports.shuffle = shuffle;
exports.pick = pick;
exports.select = select;
exports.replace = replace;
exports.generate = generate;
function randomBytes(n) {
return _randomBytes(n);
}
exports.randomBytes = randomBytes;
exports.default = {
randomBytes,
randomBit,
randomByte,
randomInt,
randomUInt,
randomFloat,
randomIn,
randomOf,
roll,
shuffle,
pick,
select,
replace,
generate,
};