{"_id":"@12core/hyperid-wasm","_rev":"2-4a3d8fa27ef374a54d099f567ee1dd53","name":"@12core/hyperid-wasm","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.3":{"name":"@12core/hyperid-wasm","version":"0.1.3","description":"hyperid implementation written in ZZ compiled to WASM format","main":"index.js","scripts":{"bench":"node benchmark.js","test":"nyc -x tests -x hyperid.js tape tests/*.js"},"keywords":["hyperid","wasm"],"author":{"name":"Joseph Werle","email":"werle@littlstar.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.4","hyperid":"^2.0.4","microtime":"^3.0.0","nyc":"^15.0.1","tape":"^5.0.0","wasm2js":"^0.2.0"},"dependencies":{"base64-wasm":"^0.2.1","uuid":"^8.0.0","uuid-parse":"^1.1.0"},"gitHead":"5c62c62e35cab227c619f6b298bf2b8651916cc3","_id":"@12core/hyperid-wasm@0.1.3","_nodeVersion":"14.0.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-yGLqdaSqNHhdKc1beUzXw5FDsEeplle+8yB1TH9NNyGVQFhAPrMSl/Sg0QK0Bk1XjhCygc8s9oGWIJUBe4fvPw==","shasum":"330ce4d80acc1fd53de6adcef2506ed5e537f25c","tarball":"https://registry.npmjs.org/@12core/hyperid-wasm/-/hyperid-wasm-0.1.3.tgz","fileCount":10,"unpackedSize":14655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevIBxCRA9TVsSAnZWagAAvgMP/2SXHbgYxRpR5Q/xfwtB\nKtYYzjRuQwwUGrTQHs/kUFO2/L+nqjl8OUEamG+Qbr2fEExvV1/PBkCh+NTy\n1rNt3hboGP2agmWvuB57WG/67SYRe2YKHKsy6z+GlYV6hTIpa9YbjpqnDkZ3\nxubTCCUl0OiyB7imnF+5gAk6uk3C2b8AidFBhPQWIEoCz9GjOYktYuk9Pjdq\nqL1y1y39y4NBXOvMyGD5BixDWH28cao3A9wV1yK5AmwSk3Uq2VbIVc9B+ck4\nLNxvSUIwScoGrzo+RHFe/2vWky/+y02eOVYIeZLBPFcF3O78HjSgUzKeLvK7\nhYvYno+rCoFiufoAnNX93AStZutCouj9nLLvsNl7QjpK6uiwbi2Xc4JBl5ao\nbcFzSpII+g3s8uwgZgFGfPWYdNGFJuuMNXbdxub/pX4Mh6MUo+9Be/R8+ccf\nTLJL0ZEWnSDI1KXmXu//lbwazMbVLUfQSiLrS/h3+IkqYhugpaBmwS/fwpiM\nnuMQ4HLUUwSd+LSJdRxA05l/BpVQpJ2xIpqpRzDphjILCyudtkIf3M3C0uUv\nheaBC8vS80U8HAtHUGHja9WWW/AibVrwX/XKG7MOQrPtHPO43WLXLxnS/Fb/\n9E5FCCA2PO3dQ7+71VnKLOq5GyMbODr27VznMXx3KxTv61V+97Eux8/x9aEV\nVuzg\r\n=ektB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfICJLUWWr3aCa2A5ZfgVU9EdQzpehpU+K0/gnT71GtQIhAJQyq9RfiobjC+GldhFW5OQ2OBSC7TLan8NdEPOgfeq3"}]},"maintainers":[{"name":"werle","email":"joseph.werle@gmail.com"},{"name":"bret","email":"bcomnes@gmail.com"}],"_npmUser":{"name":"bret","email":"bcomnes@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hyperid-wasm_0.1.3_1589411952585_0.5937819390917238"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-13T23:19:09.549Z","0.1.3":"2020-05-13T23:19:12.779Z","modified":"2022-04-04T10:31:14.867Z"},"maintainers":[{"email":"12core@littlstar.com","name":"12core-bot"},{"email":"joseph.werle@gmail.com","name":"werle"},{"email":"bcomnes@gmail.com","name":"bret"}],"description":"hyperid implementation written in ZZ compiled to WASM format","keywords":["hyperid","wasm"],"author":{"name":"Joseph Werle","email":"werle@littlstar.com"},"license":"MIT","readme":"hyperid-wasm\n============\n\n> A HyperID implementation written in [ZZ][zz] compiled to WebAssembly (WASM) format\n\n## Installation\n\n### Node\n\n```sh\n$ npm install @12core/hyperid-wasm\n```\n\n### WAPM\n\n```sh\n$ wapm install jwerle/hyperid-wasm\n```\n\n## Usage\n\n```js\nconst hyperid = require('hyperid-wasm')\n\nhyperid.ready(() => {\n  const hid = hyperid({ fixedLength: true, startFrom: 1024 })\n  console.log(hid()) // atd1gpRDT1SJZnaOhdLR5Q/0000001024\n  console.log(hid()) // atd1gpRDT1SJZnaOhdLR5Q/0000001025\n})\n```\n\n## API\n\n### `generator = hyperid([opts])`\n\nCreate a new `hyperid` generator where `opts` is the same arguments\ngiven to the original [hyperid][hyperid].\n\n```js\nconst generator = hyperid({\n  fixedLength: false, // use a fixed length counter\n  startFrom: 0, // initial counter value\n  urlSafe: false, // use URL safe characters\n})\n```\n\n### `id = generator()`\n\nGenerate a hyperid from `hyperid` context. (See above)\n\n```js\nconst id = generator()\n```\n\n## Benchmark\n\nThis [original module is][hyperid] **~4x faster** than _this one_.\n\n```\nhyperid generate - variable length (original) x 11,806,789 ops/sec ±1.59% (83 runs sampled)\nhyperid generate - variable length (wasm) x 4,179,909 ops/sec ±0.95% (88 runs sampled)\nhyperid generate - fixed length (original) x 9,347,663 ops/sec ±3.26% (88 runs sampled)\nhyperid generate - fixed length (wasm) x 3,772,629 ops/sec ±2.14% (92 runs sampled)\n```\n\n## Limits\n\n### Initial Memory\n\nBy default, this module allocates 2 pages of memory for the WebAssembly module.\nThat is `2 * 64 * 1024` bytes.\n\n### Maximum Memory\n\nThis module allows at most 256 pages of memory. That is `256 * 64 *\n1024` bytes.\n\n## See Also\n\n* https://github.com/mcollina/hyperid\n\n## License\n\nMIT\n\n[zz]: https://github.com/zetzit/zz\n[hyperid]: https://github.com/mcollina/hyperid\n","readmeFilename":"README.md"}