{"_id":"hyperdyperid","_rev":"2978703","name":"hyperdyperid","description":"Fastest random ID and random string generation for Node.js","dist-tags":{"latest":"1.2.0"},"maintainers":[{"name":"streamich","email":""}],"time":{"modified":"2023-06-21T16:43:49.000Z","created":"2020-10-12T00:49:38.038Z","1.2.0":"2022-04-23T17:10:28.495Z","1.1.0":"2022-04-23T13:43:45.764Z","1.0.1":"2020-10-12T01:00:38.533Z","1.0.0":"2020-10-12T00:49:38.038Z"},"users":{},"author":{"name":"streamich","url":"https://github.com/streamich"},"repository":{"type":"git","url":"git+https://github.com/streamich/hyperdyperid.git"},"versions":{"1.2.0":{"name":"hyperdyperid","version":"1.2.0","description":"Fastest random ID and random string generation for Node.js","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/hyperdyperid","repository":{"type":"git","url":"git+https://github.com/streamich/hyperdyperid.git"},"license":"MIT","engines":{"node":">=10.18"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","scripts":{"test":"jest --config='jest.config.js'","release":"semantic-release"},"keywords":[],"dependencies":{},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@types/jest":"^26.0.14","benchmark":"^2.1.4","hyperid":"2.0.5","jest":"^26.4.2","semantic-release":"^17.1.2","nanoid":"^3.1.12","shortid":"^2.2.15"},"release":{"verifyConditions":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],"prepare":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"]},"gitHead":"0e91332862551adf602770abfe00b708b8f711f8","bugs":{"url":"https://github.com/streamich/hyperdyperid/issues"},"_id":"hyperdyperid@1.2.0","_nodeVersion":"10.24.1","_npmVersion":"6.14.8","dist":{"shasum":"59668d323ada92228d2a869d3e474d5a33b69e6b","size":215490,"noattachment":false,"key":"/hyperdyperid/-/hyperdyperid-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hyperdyperid/download/hyperdyperid-1.2.0.tgz"},"_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"directories":{},"maintainers":[{"name":"streamich","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperdyperid_1.2.0_1650733828308_0.9501910024481417"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-23T17:10:35.563Z","publish_time":1650733828495,"_cnpm_publish_time":1650733828495},"1.1.0":{"name":"hyperdyperid","version":"1.1.0","description":"Fastest random ID and random string generation for Node.js","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/hyperdyperid","repository":{"type":"git","url":"git+https://github.com/streamich/hyperdyperid.git"},"license":"MIT","engines":{"node":">=10.18"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","scripts":{"test":"jest --config='jest.config.js'","release":"semantic-release"},"keywords":[],"dependencies":{"nanoid":"^3.1.12","shortid":"^2.2.15"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@types/jest":"^26.0.14","benchmark":"^2.1.4","hyperid":"2.0.5","jest":"^26.4.2","semantic-release":"^17.1.2"},"release":{"verifyConditions":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],"prepare":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"]},"gitHead":"6ce2591a68a549a2da5177d966b2643668b0b761","bugs":{"url":"https://github.com/streamich/hyperdyperid/issues"},"_id":"hyperdyperid@1.1.0","_nodeVersion":"10.24.1","_npmVersion":"6.14.8","dist":{"shasum":"7b06160aaee2bed0cede0e7e853a8f13f6fce367","size":214981,"noattachment":false,"key":"/hyperdyperid/-/hyperdyperid-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hyperdyperid/download/hyperdyperid-1.1.0.tgz"},"_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"directories":{},"maintainers":[{"name":"streamich","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperdyperid_1.1.0_1650721425547_0.5045849748599027"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-23T13:43:48.760Z","publish_time":1650721425764,"_cnpm_publish_time":1650721425764},"1.0.1":{"name":"hyperdyperid","version":"1.0.1","description":"Fastest random ID and random string generation for Node.js","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/hyperdyperid","repository":{"type":"git","url":"git+https://github.com/streamich/hyperdyperid.git"},"license":"MIT","engines":{"node":">=10.18"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","scripts":{"test":"jest --config='jest.config.js'","release":"semantic-release"},"keywords":[],"dependencies":{"nanoid":"^3.1.12","shortid":"^2.2.15"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@types/jest":"^26.0.14","benchmark":"^2.1.4","hyperid":"2.0.5","jest":"^26.4.2","semantic-release":"^17.1.2"},"release":{"verifyConditions":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],"prepare":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"]},"gitHead":"a4bda046899766a4a12887f0168ece890716b4c1","bugs":{"url":"https://github.com/streamich/hyperdyperid/issues"},"_id":"hyperdyperid@1.0.1","_nodeVersion":"10.22.1","_npmVersion":"6.14.8","dist":{"shasum":"83348414d95c2e0a1558dc1d39d05e628520c1f0","size":214084,"noattachment":false,"key":"/hyperdyperid/-/hyperdyperid-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hyperdyperid/download/hyperdyperid-1.0.1.tgz"},"maintainers":[{"name":"streamich","email":""}],"_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperdyperid_1.0.1_1602464438305_0.913610848998381"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T18:50:04.240Z","publish_time":1602464438533,"_cnpm_publish_time":1602464438533},"1.0.0":{"name":"hyperdyperid","version":"1.0.0","description":"Fastest random ID and random string generation for Node.js","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/hyperdyperid","repository":{"type":"git","url":"git+https://github.com/streamich/hyperdyperid.git"},"license":"MIT","engines":{"node":">=10.18"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","scripts":{"test":"jest --config='jest.config.js'","release":"semantic-release"},"keywords":[],"dependencies":{"nanoid":"^3.1.12","shortid":"^2.2.15"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@types/jest":"^26.0.14","benchmark":"^2.1.4","hyperid":"2.0.5","jest":"^26.4.2","semantic-release":"^17.1.2"},"release":{"verifyConditions":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"],"prepare":["@semantic-release/changelog","@semantic-release/npm","@semantic-release/git"]},"gitHead":"1c622af07ec9fc3c8ac7ed05023550980e3b23f6","bugs":{"url":"https://github.com/streamich/hyperdyperid/issues"},"_id":"hyperdyperid@1.0.0","_nodeVersion":"10.22.1","_npmVersion":"6.14.8","dist":{"shasum":"5f9e3676a588fa5efcda45e061ee19b195f0c510","size":213937,"noattachment":false,"key":"/hyperdyperid/-/hyperdyperid-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hyperdyperid/download/hyperdyperid-1.0.0.tgz"},"maintainers":[{"name":"streamich","email":""}],"_npmUser":{"name":"streamich","email":"vadimsdaleckis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperdyperid_1.0.0_1602463777862_0.7469814285116663"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-26T18:50:02.449Z","publish_time":1602463778038,"_cnpm_publish_time":1602463778038}},"readme":"# `hyperdyperid`\n\nFastest random ID and random string generation for Node.js\n\n- `str3_36` &mdash; generates random 3 character Base36 alphanumeric string.\n- `str5_36` &mdash; generates random 5 character Base36 alphanumeric string.\n- `str6_36` &mdash; generates random 6 character Base36 alphanumeric string.\n- `str10_36` &mdash; generates random 10 character alphanumeric string.\n- `str(len [, alphabet])` &mdash; generates any length random string using an `alphabet`. Use like `str(10, '0123456789')`.\n- `hyperid` &mdash; generates \"hyperid\" like ID.\n- `xorshift32` &mdash; iterates through pseudo random numbers using \"xorshift32\" algorithm. This used\n  to be the algorithm behind `Math.random()` in V8, then it switched to \"xorshift64\".\n- `randomU32(min, max)` &mdash; generate a random 32-bit integer.\n\n\n## Usage\n\nInstall\n\n```\nyarn add hyperdyperid\n```\n\nGenerate base36 10-character string:\n\n```js\nconst {str10_36} = require('hyperdyperid/lib/str10_36');\n\nstr10_36();\n// lxifpmidcr\n// cn41vpmtxo\n// dj2u5ghp3r\n// 6yro5d0g9l\n```\n\n\n## Performance\n\nRan on Mac Mini M1.\n\nRandom ID generation:\n\n```\nnode -v\nv16.14.2\nnode benchmarks/main.js \nhyperdyperid xorshift32() x 241,258,490 ops/sec ±1.97% (78 runs sampled)\nhyperdyperid str3_36() x 203,361,942 ops/sec ±1.57% (82 runs sampled)\nhyperdyperid str5_36() x 124,134,559 ops/sec ±1.74% (85 runs sampled)\nhyperdyperid str6_36() x 125,011,053 ops/sec ±2.48% (70 runs sampled)\nhyperdyperid str10_36() x 19,445,199 ops/sec ±1.92% (84 runs sampled)\nhyperdyperid str(5) x 5,940,801 ops/sec ±1.70% (82 runs sampled)\nhyperdyperid str(10) x 2,798,758 ops/sec ±1.45% (65 runs sampled)\nhyperdyperid hyperid() x 26,317,209 ops/sec ±2.61% (76 runs sampled)\nhyperid x 17,018,022 ops/sec ±1.66% (84 runs sampled)\nMath.random() x 72,294,752 ops/sec ±1.65% (83 runs sampled)\nMath.random().toString() x 4,503,932 ops/sec ±2.68% (80 runs sampled)\nnanoid x 470,470 ops/sec ±3.17% (77 runs sampled)\nshortid x 41,870 ops/sec ±6.21% (67 runs sampled)\nFastest is hyperdyperid xorshift32()\n```\n\nRandom integer generation:\n\n```\nnode -v\nv16.14.2\nnode benchmarks/randomU32.js \nrandomU32(min, max) x 248,233,310 ops/sec ±1.91% (73 runs sampled)\nMath.random() * (max - min + 1) + min x 35,034,863 ops/sec ±1.75% (81 runs sampled)\nFastest is randomU32(min, max)\n```\n\n\n## License\n\n[MIT © Vadim Dalecky](LICENSE).\n","_attachments":{},"homepage":"https://github.com/streamich/hyperdyperid","bugs":{"url":"https://github.com/streamich/hyperdyperid/issues"},"license":"MIT"}