{"name":"short-unique-id","version":"3.0.0-rc2","description":"Generate random or sequential UUID of any length","keywords":["short","random","uid","uuid","guid","unique id","tiny"],"main":"lib/short-unique-id.js","license":"Apache-2.0","module":"lib/short-unique-id.js","homepage":"https://jeanlescure.github.io/short-unique-id/","repository":{"type":"git","url":"git+https://github.com/jeanlescure/short-unique-id.git"},"runkitExampleFilename":"./test/runkit.js","scripts":{"gen:version":"echo \"export default '`jq -r .version package.json`';\" > short_uuid/version.ts","gen:docs":"cd short_uuid && typedoc --readme ../README.md --theme ../node_modules/short_uuid_typedoc_template/bin/default --out ../docs . && cd .. && cp -r ./assets ./docs && mv ./docs/assets/favicon.ico ./docs/ && echo shortunique.id > ./docs/CNAME","lib:build":"yarn gen:version && rm ./lib/* ; mkdir -p tmp && cd short_uuid && deno bundle mod.ts ../tmp/mod.js && deno bundle version.ts ../tmp/version.js && cd .. && sucrase ./tmp -d ./lib -t imports && mv ./lib/mod.js ./lib/short-unique-id.js && rm -rf ./tmp","dist:build":"yarn lib:build && rm ./dist/* ; echo 'var __suid_module = ' > ./dist/short-unique-id.js && browserify ./lib/short-unique-id.js >> ./dist/short-unique-id.js && echo 'var ShortUniqueId = __suid_module(1)[\"default\"];' >> ./dist/short-unique-id.js && minify ./dist/short-unique-id.js > ./dist/short-unique-id.min.js","test":"yarn gen:version && cd short_uuid && deno test && cd .. && yarn link && yarn link short-unique-id && node ./runkit.js","lint":"tslint ./short_uuid/*.ts"},"devDependencies":{"browserify":"^16.5.1","minify":"^5.1.1","short_uuid_typedoc_template":"^1.0.8","sucrase":"^3.13.0","tslint":"^6.1.1","tslint-config-airbnb-base":"^0.3.0","typedoc":"^0.17.6","typescript":"^3.8.3"},"readme":"# Short Unique ID (UUID) Generating Library\n![CD](https://github.com/jeanlescure/short-unique-id/workflows/CD/badge.svg)\n[![Try short-unique-id on RunKit](https://badge.runkitcdn.com/short-unique-id.svg)](https://npm.runkit.com/short-unique-id)\n[![NPM Downloads](https://img.shields.io/npm/dt/short-unique-id.svg?maxAge=2592000)](https://npmjs.com/package/short-unique-id)\n\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![3 Contributors](https://img.shields.io/badge/all_contributors-3-purple.svg?style=flat-square)](#contributors)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\n## Documentation and Online Short UUID Generator\n\nYou can find the docs and online generator at:\n\n<a target=\"_blank\" href=\"https://shortunique.id\">https://shortunique.id</a>\n\n## What is the probability of generating the same id again?\n\nThis largely depends on the given dictionary and the selected UUID length.\n\nOut of the box this library provides a shuffled dictionary of digits from\n0 to 9, as well as the alphabet from a to z both in UPPER and lower case,\nwith a default UUID length of 6. That gives you a total of 56,800,235,584\npossible UUIDs.\n\nSo, given the previous values, the probability of generating a duplicate\nin 1,000,000 rounds is ~0.00000002, or about 1 in 50,000,000.\n\nIf you change the dictionary and/or the UUID length then we have provided\nthe function `collisionProbability()` function to calculate the probability\nof hitting a duplicate in a given number of rounds (a collision) and the\nfunction `uniqueness()` which provides a score (from 0 to 1) to rate the \n\"quality\" of the combination of given dictionary and UUID length (the closer\nto 1, higher the uniqueness and thus better the quality).\n\nTo find out more about the math behind these functions please refer to the\n<a target=\"_blank\" href=\"https://shortunique.id/classes/shortuniqueid.html#collisionprobability\">API Reference</a>.\n\n\n## V3.x\n\nVersion 3.0 is a re-write of this library aiming to use [Deno](https://deno.land/) as the driving\nforce of the development and distribution of Short Unique ID.\n\nWe did this by separating the Deno compatible typescript logic into a [git submodule](https://github.com/jeanlescure/short_uuid)\nwhich gets bundled for the rest of the platforms by the scripts within the\n`package.json` in this repo.\n\nAnother reason for the re-write was to define a new license for the source\ncode within this repo, the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).\n\n## \"Deno\" who? what?\n\nRyan Dahl, creator of Node.js, has spent the last couple of years working\non Deno, a new runtime for JavaScript that is supposed to fix all the inherent\nproblems of Node.\n\nWe have tried it out and are convinced that Deno is stable enough and\ndelivers on all expectations we could have.\n\nFor more info check out this [detailed look at Deno from LogRocket's blog](https://blog.logrocket.com/what-is-deno/).\n\n## Acknowledgement and platform support\n\nThis repo and npm package started as a straight up manual transpilation to ES6 of the [short-uid](https://github.com/serendipious/nodejs-short-uid) npm package by [Ankit Kuwadekar](https://github.com/serendipious/).\n\n![image depicting over 5000 weekly npm downloads](https://raw.githubusercontent.com/jeanlescure/short-unique-id/master/assets/weekly-downloads.png)\n\nSince this package is now reporting between 4k and 5k+ npm weekly downloads, we've gone ahead and re-written the whole of it in TypeScript and made sure to package lib and dist modules compatible with Deno, Node.js and all major Browsers.\n\n## Development\n\nClone this repo (including submodules):\n\n```sh\n# SSH\ngit clone --recurse-submodules git@github.com:jeanlescure/short-unique-id.git\n\n# HTTPS\ngit clone --recurse-submodules https://github.com/jeanlescure/short-unique-id.git\n```\n\nTests run using [Deno](https://deno.land/std/testing/):\n\n```\nyarn test\n```\n\nUsing [airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) rules for [tslint](https://palantir.github.io/tslint/):\n\n```\nyarn lint\n```\n\n## Build\n\nIn order to publish the latest changes you must build the library and distribution files:\n\n```\nyarn lib:build\nyarn dist:build\n```\n\n**IMPORTANT**: The `dist:build` script depends on the files generated by `lib:build`.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/serendipious\"><img src=\"https://shortunique.id/assets/contributors/serendipious.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short-unique-id/commits?author=serendipious\" title=\"Code\">💻</a></td></tr></tbody></table></td>\n    <td align=\"center\"><a href=\"https://jeanlescure.cr\"><img src=\"https://shortunique.id/assets/contributors/jeanlescure.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"#maintenance-jeanlescure\" title=\"Maintenance\">🚧</a> <a href=\"https://github.com/jeanlescure/short-unique-id/commits?author=jeanlescure\" title=\"Code\">💻</a> <a href=\"#content-jeanlescure\" title=\"Content\">🖋</a> <a href=\"https://github.com/jeanlescure/short-unique-id/commits?author=jeanlescure\" title=\"Documentation\">📖</a> <a href=\"https://github.com/jeanlescure/short-unique-id/commits?author=jeanlescure\" title=\"Tests\">⚠️</a></td></tr></tbody></table></td>\n    <td align=\"center\"><a href=\"https://dianalu.design\"><img src=\"https://shortunique.id/assets/contributors/dilescure.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short_uuid/commits?author=DiLescure\" title=\"Code\">💻</a></td></tr></tbody></table></td>\n    <td align=\"center\"><a href=\"https://github.com/EmerLM\"><img src=\"https://shortunique.id/assets/contributors/emerlm.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short_uuid/commits?author=EmerLM\" title=\"Code\">💻</a></td></tr></tbody></table></td>\n    </tr>\n    <tr>\n    <td align=\"center\"><a href=\"https://github.com/angelnath26\"><img src=\"https://shortunique.id/assets/contributors/angelnath26.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short_uuid/commits?author=angelnath26\" title=\"Code\">💻</a> <a href=\"https://github.com/jeanlescure/short_uuid/pulls?q=is%3Apr+reviewed-by%3Aangelnath26\" title=\"Reviewed Pull Requests\">👀</a></td></tr></tbody></table></td>\n    <td align=\"center\"><a href=\"https://twitter.com/jeffturcotte\"><img src=\"https://shortunique.id/assets/contributors/jeffturcotte.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short-unique-id/commits?author=jeffturcotte\" title=\"Code\">💻</a></td></tr></tbody></table></td>\n    <td align=\"center\"><a href=\"https://github.com/neversun\"><img src=\"https://shortunique.id/assets/contributors/neversun.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short-unique-id/commits?author=neversun\" title=\"Code\">💻</a></td></tr></tbody></table></td>\n    <td align=\"center\"><a href=\"https://github.com/ekelvin\"><img src=\"https://shortunique.id/assets/contributors/ekelvin.svg\" /></a><table><tbody><tr><td width=\"150\" align=\"center\"><a href=\"https://github.com/jeanlescure/short-unique-id/issues/19\" title=\"Ideas, Planning, & Feedback\">🤔</a></td></tr></tbody></table></td>\n  </tr>\n</table>\n\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\nCopyright (c) 2018-2020 [Short Unique ID Contributors](https://github.com/jeanlescure/short-unique-id/graphs/contributors).<br/>\nLicensed under the Apache License 2.0.","readmeFilename":"README.md","gitHead":"6e9e37ce692a87eb09782c5f859981817865abf7","bugs":{"url":"https://github.com/jeanlescure/short-unique-id/issues"},"_id":"short-unique-id@3.0.0-rc2","_nodeVersion":"13.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-tY50vOHVc7iCnFZwvvvTwBzGAqLaqihI3KFwHL21zzOm8r5ItrKNGsTofg8sBWw+7zze0SNnf8Xlu/yo92+40w==","shasum":"d01228cdc4df7c95230eae022c3a7fa77472336b","tarball":"http://registry-npm.ywwl.com/short-unique-id/download/short-unique-id-3.0.0-rc2.tgz","fileCount":48,"unpackedSize":431669,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuQUVCRA9TVsSAnZWagAAqrsP/jui6adgxJUMCOD+qmt4\ne1lplSujds2NAjOXyDKlk8f5rApNN5qsgR7M72LwCuDBdPr/WjyNC9/lGgEF\np6RQ1AJdpca+dJ4kqqPQxWibhpW3nkfsYvTpev/lRWUwmf0kb+oRV2aDmuRv\n9oxe58aWgnP3Oz9Lgdb3I8T7S5AMt91pVk/c3a2fMV0MTmYycE6wsWhvHWeR\nz0MWx3GBPjAP2akpO6Xw7I2ztWMtXyYE4mBeZ42X7r5MOauF9I6tmGjVtaN7\nc+mkANlMlahl2Ny/mVspUOpFqfgOgYy9ZA2FUzgFvZPGjZZbzyU/fKtr9QFm\nImayy2dGUIF61hn71jSctZizs3FXC9SJz+dPRj+g5NkX4XuBpLyI4x+9AmVB\ni2PzY3YSL65UTcpbmFy8TIFTp0ht+GWRMSGVWd+YvzIPDSg67jaODZFdpEh+\n8kZ0S/tf03MHNgR/0W9ZNFEIp+gaZXPwgC0C6u4rbrOcDEs9nDXsCNAynciI\nRTCDruY9jPWmqzjfWWW/KdsRbcPkvJh0/2CJej5rH4UtOuy9BYpGqpAWexT1\n+qzPhG+k7CvXan7W+kDJM7mnRmh9YtbFAHY9zp25vAZ48RmAz13F2Gtqur9+\nFXVK8/9y22hi9mZHiSzVvUrapAGgyc9BA/Jk2VxrbI3l10dA/FJngyd0D3Pj\nRcW2\r\n=8DNQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIELsOJuLeYxnLb/SpS9WvHQFrGp6DEKTgGQJO+QUzSEsAiBdYEBkyLJZ3+rarsYw5iQTE/jHEBSaoQ07TcZzlUZUrg=="}],"size":132517,"noattachment":false,"key":"/short-unique-id/-/short-unique-id-3.0.0-rc2.tgz"},"maintainers":[{"name":"jeanlescure","email":"jean@ticowebmedia.com"}],"_npmUser":{"name":"jeanlescure","email":"jeanmlescure@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/short-unique-id_3.0.0-rc2_1589183765286_0.8067008388493049"},"_hasShrinkwrap":false,"publish_time":1589183765457,"_cnpm_publish_time":1589183765457,"dist-tags":{"latest":"5.3.2","next":"3.0.0-rc2"}}