nonce-fast
Version:
nonce value generator
47 lines (34 loc) ⢠1.56 kB
Markdown
[](https://travis-ci.org/bmunoz89/nonce-fast)
[](https://codeclimate.com/github/bmunoz89/nonce-fast/maintainability)
[](https://codeclimate.com/github/bmunoz89/nonce-fast/test_coverage)
[](https://badge.fury.io/js/nonce-fast)
[](https://www.npmjs.com/package/nonce-fast)
[](https://david-dm.org/bmunoz89/nonce-fast)
[](https://david-dm.org/bmunoz89/nonce-fast)
# Welcome
## Install
```bash
npm i nonce-fast
```
or
```bash
yarn add nonce-fast
```
## Usage
```javascript
const Nonce = require('nonce-fast'),
nonce = Nonce(9); # define the length of the string
nonce(); # '802354675'
nonce(); # '296876554'
nonce(); # '269567223'
```
## Benchmark
Compared with the original nonce generator
```
Nonce x 1,783,560 ops/sec ±1.69% (83 runs sampled)
NonceFast x 5,832,445 ops/sec ±2.35% (77 runs sampled)
Fastest is NonceFast
```
š Some hugs to [Abrkn][github-user-abrkn] for the original project [nonce][github-rep-nonce] š»
[github-user-abrkn]: https://github.com/abrkn
[github-rep-nonce]: https://github.com/abrkn/nonce