Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Jan 4, 2022
1 parent fa1ffea commit 0172419
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ Uber-fast unique id generation, for Node.js and the browser.
Here are the benchmarks:

```
crypto.randomUUID x 17,588,371 ops/sec ±0.86% (93 runs sampled)
hashids process.hrtime x 387,622 ops/sec ±0.18% (97 runs sampled)
hashids counter x 678,926 ops/sec ±0.23% (95 runs sampled)
tshortid x 35,616 ops/sec ±3.56% (85 runs sampled)
crypto.random x 323,029 ops/sec ±3.15% (84 runs sampled)
nid x 1,387,186 ops/sec ±0.25% (99 runs sampled)
uuid.v4 x 1,336,178 ops/sec ±0.34% (100 runs sampled)
uuid.v1 x 2,004,247 ops/sec ±0.05% (98 runs sampled)
nanoid x 2,327,169 ops/sec ±0.36% (96 runs sampled)
hyperid - variable length x 21,170,011 ops/sec ±0.39% (95 runs sampled)
hyperid - fixed length x 20,205,619 ops/sec ±0.17% (96 runs sampled)
hyperid - fixed length, url safe x 21,195,238 ops/sec ±0.58% (94 runs sampled)
crypto.randomUUID x 17,421,022 ops/sec ±1.05% (92 runs sampled)
hashids process.hrtime x 381,775 ops/sec ±0.22% (95 runs sampled)
hashids counter x 730,949 ops/sec ±0.23% (97 runs sampled)
shortid x 34,682 ops/sec ±3.82% (83 runs sampled)
crypto.random x 313,547 ops/sec ±2.88% (82 runs sampled)
nid x 1,365,624 ops/sec ±0.07% (96 runs sampled)
uuid.v4 x 1,313,028 ops/sec ±0.10% (97 runs sampled)
napiRsUuid.v4 x 536,390 ops/sec ±0.20% (96 runs sampled)
uuid.v1 x 1,999,272 ops/sec ±0.09% (98 runs sampled)
nanoid x 3,808,014 ops/sec ±0.33% (95 runs sampled)
hyperid - variable length x 20,197,843 ops/sec ±0.74% (94 runs sampled)
hyperid - fixed length x 18,894,869 ops/sec ±0.12% (95 runs sampled)
hyperid - fixed length, url safe x 20,158,778 ops/sec ±0.54% (94 runs sampled)
```

_Note:_ Benchmark run with Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz and Node.js v16.3.0
Expand Down Expand Up @@ -59,7 +60,7 @@ that is 33 characters in length, by default `fixedLength` is `false`.
- `options: Object`
If `{ fixedLength: true }` is passed in, the function will always generate an id
that is 33 characters in length, by default `fixedLength` is `false`.
If `{ urlSafe: true }` is passed in, the function will generate url safe ids.
If `{ urlSafe: true }` is passed in, the function will generate url safe ids according to RFC4648.
If `{ startFrom: <int> }` is passed in, the first counter will start from that
number, which must be between 0 and 2147483647. Fractions are discarded, only the
integer part matters.
Expand Down

0 comments on commit 0172419

Please sign in to comment.