{"_id":"crypto-random-string-with-promisify-polyfill","_rev":"4-51f45d779fb072a33ba512e0d08c637e","name":"crypto-random-string-with-promisify-polyfill","dist-tags":{"latest":"5.0.0"},"versions":{"4.0.0":{"name":"crypto-random-string-with-promisify-polyfill","version":"4.0.0","description":"Generate a cryptographically strong random string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/wolfflow/crypto-random-string.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["random","string","text","id","identifier","slug","salt","pin","crypto","strong","secure","hex","secret","protect"],"dependencies":{"type-fest":"^1.0.1"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"5155c8e67bdc5470e98213e211bbd869ff06c564","bugs":{"url":"https://github.com/wolfflow/crypto-random-string/issues"},"homepage":"https://github.com/wolfflow/crypto-random-string#readme","_id":"crypto-random-string-with-promisify-polyfill@4.0.0","_nodeVersion":"16.3.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-bLgFmf3STXZ5PP3U2u4q8XulIHPn2kpycGV+oh7U+dkCO2pTERIw4lVPTr0ozKBCpQ5LO8BbyCKJg3ghT5QFZQ==","shasum":"b57fd45e52d552e48debe02e16c7a5de82b194e9","tarball":"https://registry.npmjs.org/crypto-random-string-with-promisify-polyfill/-/crypto-random-string-with-promisify-polyfill-4.0.0.tgz","fileCount":5,"unpackedSize":15561,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDl1dXrvz6/+vCd3Ujycsph6IMEWg2dqO1AD8Kngk7xrwIhAOXPVNbpGdZbyyG5CUvMP/0mf0lOy4rCSiJQw2yIDuFc"}]},"_npmUser":{"name":"bookmate-npm","email":"npm@bookmate.com"},"directories":{},"maintainers":[{"name":"bookmate-npm","email":"npm@bookmate.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crypto-random-string-with-promisify-polyfill_4.0.0_1632214555626_0.5478232686557156"},"_hasShrinkwrap":false},"4.1.0":{"name":"crypto-random-string-with-promisify-polyfill","version":"4.1.0","description":"Generate a cryptographically strong random string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/wolfflow/crypto-random-string.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["random","string","text","id","identifier","slug","salt","pin","crypto","strong","secure","hex","secret","protect"],"dependencies":{"type-fest":"^0.8.1"},"devDependencies":{"ava":"^2.1.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"b348c5dc1027d283e1812289e0b1f46be74e44a4","bugs":{"url":"https://github.com/wolfflow/crypto-random-string/issues"},"homepage":"https://github.com/wolfflow/crypto-random-string#readme","_id":"crypto-random-string-with-promisify-polyfill@4.1.0","_nodeVersion":"16.3.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-zM/WTkxhrW9RGJH34vxl8IywcbN0H9VBgUDtCmNf4mMvbDGZ7rZO6gpXxXzZ63xKTd0Fo7jHIqgA9YKjSTnFJQ==","shasum":"7fa00cdebe5eebcd4aa9d1473d9ed377c8f0a189","tarball":"https://registry.npmjs.org/crypto-random-string-with-promisify-polyfill/-/crypto-random-string-with-promisify-polyfill-4.1.0.tgz","fileCount":5,"unpackedSize":14495,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzUmIpru1hwjMOK7QZgYa797VGAyR1p1FonOTFZIvFYQIgbjKPbRdHECvP/3NklIGdxExdJoTtiyDU0kyMkmLVr9Q="}]},"_npmUser":{"name":"bookmate-npm","email":"npm@bookmate.com"},"directories":{},"maintainers":[{"name":"bookmate-npm","email":"npm@bookmate.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crypto-random-string-with-promisify-polyfill_4.1.0_1632301199237_0.7648747455184384"},"_hasShrinkwrap":false},"5.0.0":{"name":"crypto-random-string-with-promisify-polyfill","version":"5.0.0","description":"Generate a cryptographically strong random string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/wolfflow/crypto-random-string.git"},"author":{"name":"wolfflow","email":"x.flowwolf@gmail.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["random","string","text","id","identifier","slug","salt","pin","crypto","strong","secure","hex","secret","protect"],"dependencies":{"randombytes":"^2.1.0","type-fest":"^0.8.1"},"devDependencies":{"ava":"^2.1.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"35d5c8929eb8987fb780f27697066ff5c31707f5","bugs":{"url":"https://github.com/wolfflow/crypto-random-string/issues"},"homepage":"https://github.com/wolfflow/crypto-random-string#readme","_id":"crypto-random-string-with-promisify-polyfill@5.0.0","_nodeVersion":"16.3.0","_npmVersion":"7.19.0","dist":{"integrity":"sha512-kPFnuIKcC4Lz463QA5iax2NgVQlWdFQ8G58pHtoroZZtwIROyUwtttOPmA3MJeXvv+SKpSf2g+m6PoxrV0Z55Q==","shasum":"df3744d19001c1943ffaecfa0654b611bffdcd70","tarball":"https://registry.npmjs.org/crypto-random-string-with-promisify-polyfill/-/crypto-random-string-with-promisify-polyfill-5.0.0.tgz","fileCount":5,"unpackedSize":14475,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2nUnCRA9TVsSAnZWagAAN/EP/3E1SXh7+xaC66f/baFg\nU2b0l2o7jvEpnkDN5zTvkUwU26HKN6V/rR1abP/PMEYi62spKWjq2lV7FOU+\nEGnN6ltCIVdSfzLvyoLks9hpFBpIW6wJJWOrheExHcNuhkoPloSWG4qO5noT\njvbDil0SkCBi4M7KshJg6cOkE77i4W3AWD2u/IdNxwupzwL30pB2PoxbM13m\nOkc3B39BU1xuBgYvkSQyYtHKGbcj6PYUyFhYvZowkuVE48oRNnssEkEQr+Ga\njXhpq2WlGNdqWiLFc3g+yB10YpP8Q+CO7uYLUrsASRmnuJaXYAZW1L5GYNje\nivU4W5Ko733MQL1R1pL4d7ntoXgvh/qtNpPvDAiDDY6if6cfHjTdb74LlYbc\n/EQuFMAMKF1xK1VLJn+/K4MvvCC5oSsWJSQXpTxCTnZ8SvgGe67Tic55QewB\nihzXGbtViNWdvJoBVcgBmZm2Fyk3cTNyMVkXul3pc3+WB/4A5onQi/8Sg6gV\nw/qX11OLxNEjNyv+VnntObZQZri8V5lYZMvcAeys9oCLt+SGUdn12NmPKsHC\nTgTp2iRJ5fgenQjB2hCGNwy933OdThbEnHkaTbYgzOLbKsk5GyIgC35pgvHS\nP9t6a2Pn1Fb7bCbu86mlOmyNHmko4BV5OCpcUwRX7KTLI9GISeIMs0zmKILS\nFSkH\r\n=2t0x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCv+jC+kWqdWDDm7EHFoxerl4ne0usnDBTVtrYpn8mIgAIhAMAejqgS5qNGjZ8VmT35xkQnXmuujEvW+LjeKxe9yBpi"}]},"_npmUser":{"name":"bookmate-npm","email":"npm@bookmate.com"},"directories":{},"maintainers":[{"name":"bookmate-npm","email":"npm@bookmate.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/crypto-random-string-with-promisify-polyfill_5.0.0_1633532983761_0.06349312795016138"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-21T08:55:55.625Z","4.0.0":"2021-09-21T08:55:55.764Z","modified":"2022-04-27T22:53:30.731Z","4.1.0":"2021-09-22T08:59:59.364Z","5.0.0":"2021-10-06T15:09:43.906Z"},"maintainers":[{"name":"bookmate-npm","email":"npm@bookmate.com"}],"description":"Generate a cryptographically strong random string","homepage":"https://github.com/wolfflow/crypto-random-string#readme","keywords":["random","string","text","id","identifier","slug","salt","pin","crypto","strong","secure","hex","secret","protect"],"repository":{"type":"git","url":"git+https://github.com/wolfflow/crypto-random-string.git"},"author":{"name":"wolfflow","email":"x.flowwolf@gmail.com"},"bugs":{"url":"https://github.com/wolfflow/crypto-random-string/issues"},"license":"MIT","readme":"# crypto-random-string\n\n> Generate a [cryptographically strong](https://en.wikipedia.org/wiki/Strong_cryptography) random string\n\nCan be useful for creating an identifier, slug, salt, PIN code, fixture, etc.\n\n## Install\n\n```\n$ npm install crypto-random-string\n```\n\n## Usage\n\n```js\nconst cryptoRandomString = require('crypto-random-string');\n\ncryptoRandomString({length: 10});\n//=> '2cf05d94db'\n\ncryptoRandomString({length: 10, type: 'base64'});\n//=> 'YMiMbaQl6I'\n\ncryptoRandomString({length: 10, type: 'url-safe'});\n//=> 'YN-tqc8pOw'\n\ncryptoRandomString({length: 10, type: 'numeric'});\n//=> '8314659141'\n\ncryptoRandomString({length: 6, type: 'distinguishable'});\n//=> 'CDEHKM'\n\ncryptoRandomString({length: 10, type: 'ascii-printable'});\n//=> '`#Rt8$IK>B'\n\ncryptoRandomString({length: 10, type: 'alphanumeric'});\n//=> 'DMuKL8YtE7'\n\ncryptoRandomString({length: 10, characters: 'abc'});\n//=> 'abaaccabac'\n```\n\n## API\n\n### cryptoRandomString(options)\n\nReturns a randomized string. [Hex](https://en.wikipedia.org/wiki/Hexadecimal) by default.\n\n### cryptoRandomString.async(options)\n\nReturns a promise which resolves to a randomized string. [Hex](https://en.wikipedia.org/wiki/Hexadecimal) by default.\n\n#### options\n\nType: `object`\n\n##### length\n\n*Required*\\\nType: `number`\n\nLength of the returned string.\n\n##### type\n\nType: `string`\\\nDefault: `'hex'`\\\nValues: `'hex' | 'base64' | 'url-safe' | 'numeric' | 'distinguishable' | 'ascii-printable' | 'alphanumeric'`\n\nUse only characters from a predefined set of allowed characters.\n\nCannot be set at the same time as the `characters` option.\n\nThe `distinguishable` set contains only uppercase characters that are not easily confused: `CDEHKMPRTUWXY012458`. It can be useful if you need to print out a short string that you'd like users to read and type back in with minimal errors. For example, reading a code off of a screen that needs to be typed into a phone to connect two devices.\n\nThe `ascii-printable` set contains all [printable ASCII characters](https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters): ``!\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~`` Useful for generating passwords where all possible ASCII characters should be used.\n\nThe `alphanumeric` set contains uppercase letters, lowercase letters, and digits: `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`. Useful for generating [nonce](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/nonce) values.\n\n##### characters\n\nType: `string`\\\nMinimum length: `1`\\\nMaximum length: `65536`\n\nUse only characters from a custom set of allowed characters.\n\nCannot be set at the same time as the `type` option.\n\n## Related\n\n- [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer\n- [random-float](https://github.com/sindresorhus/random-float) - Generate a random float\n- [random-item](https://github.com/sindresorhus/random-item) - Get a random item from an array\n- [random-boolean](https://github.com/arthurvr/random-boolean) - Get a random boolean\n- [random-obj-key](https://github.com/sindresorhus/random-obj-key) - Get a random key from an object\n- [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object\n- [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-crypto-random-string?utm_source=npm-crypto-random-string&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","readmeFilename":"readme.md"}