An open API service indexing awesome lists of open source software.

https://github.com/bddjr/webcrypto-random-int

πŸš€Like golang, get crypto random integer or bigint.πŸ”
https://github.com/bddjr/webcrypto-random-int

crypto randint random random-int random-integers randomint webcrypto

Last synced: 3 months ago
JSON representation

πŸš€Like golang, get crypto random integer or bigint.πŸ”

Awesome Lists containing this project

README

        

# webcrypto-random-int

Like golang, get crypto random integer or bigint.

## NPM
```
npm i webcrypto-random-int --save-dev
```

## Example
```js
import CryptoRandInt from "webcrypto-random-int";

console.log("canIUse " + CryptoRandInt.canIUse);
if (CryptoRandInt.canIUse) {
console.log(CryptoRandInt.numInt(62));
console.log(CryptoRandInt.bigInt(2n ** 128n));
console.log(CryptoRandInt.str(
32,
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
));
}
```
```
canIUse true
53
216521706795757442119767567038153766458
SK2jwNqt3xvP1zuSwJt7CcxAI4T2GYbA
```

## Test

```
npm -g i live-server
npm run example
```