Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

crypto-random-bigint

fabiospampinato8.2kMIT2.1.1TypeScript support: included

Generate a cryptographically-random BigInt with the given number of bits of entropy.

crypto, random, bigint, number

readme

Crypto Random BigInt

Generate a cryptographically-random BigInt with the given number of bits of entropy.

It's pretty darn fast, tiny, and it works everywhere. It's like a purer version of nanoid.

Install

npm install crypto-random-bigint

Usage

import random from 'crypto-random-bigint';

// Let's get some random BigInts

random ( 8 ); // => 132n
random ( 16 ); // => 54279n
random ( 32 ); // => 3564608120n
random ( 64 ); // => 15255558299082773463n
random ( 128 ); // => 102272854662000556975733753112255674405n

License

MIT © Fabio Spampinato