{"_id":"unique-random","_rev":"18-5346710034d80043186d4d1e1947bb3d","name":"unique-random","description":"Generate random numbers that are consecutively unique","dist-tags":{"latest":"4.0.0"},"versions":{"0.1.0":{"name":"unique-random","version":"0.1.0","description":"Generate random numbers that are consecutively unique","keywords":["unique","random","rand","number","single","generate","non-repeating"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"files":["unique-random.js"],"main":"unique-random","repository":{"type":"git","url":"git://github.com/sindresorhus/unique-random.git"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"~1.14.0"},"engines":{"node":">=0.8.0"},"bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random","_id":"unique-random@0.1.0","dist":{"shasum":"9a9039a431b30ee875ae0ec91fc49de6246af4ce","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-0.1.0.tgz","integrity":"sha512-dQLqCb+blGyMASsBPFG7DqPgD1X0nW6R+flio3EMckv6zwvCZPuOe6A+o0nTf/iyJU4xTeBtoL4EiGSuMwwp2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEE6PHoDIsMh2cokCY9KuSfpOimbUAoLpwv5uDeYkwXCAiEA+sA/TMd766Mk8MoQmalEl8M0zUisDZjXWn+/b0ZSUuQ="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"0.1.1":{"name":"unique-random","version":"0.1.1","description":"Generate random numbers that are consecutively unique","keywords":["unique","random","rand","number","single","generate","non-repeating"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"files":["unique-random.js"],"main":"unique-random","repository":{"type":"git","url":"git://github.com/sindresorhus/unique-random"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*"},"engines":{"node":">=0.8.0"},"bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random","_id":"unique-random@0.1.1","dist":{"shasum":"c4ccaabedaab8534e0f54daf5f10743ee5c692ad","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-0.1.1.tgz","integrity":"sha512-lwUnHNj3lGKxLWkt6Mv5ZDIFpA68Y3IBstzCmCPjyRRnL7MSFgBfOyU+35RuzgQ7yRAnRw9o25e28YqvpZfYug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3MCEQoY6S6ZwCEavrnNPrpysInUWwWsKVQio9vZw7pAiBodOf6dYY5it3w9ahHDozlfvDj4pYHNDDfOFqmB1cjxg=="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"1.0.0":{"name":"unique-random","version":"1.0.0","description":"Generate random numbers that are consecutively unique","keywords":["unique","random","rand","number","single","generate","non-repeating"],"license":"MIT","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"files":["index.js"],"repository":{"type":"git","url":"https://github.com/sindresorhus/unique-random"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*"},"engines":{"node":">=0.10.0"},"gitHead":"fb783f82b680182eaf65defe1f75fe5ee8683261","bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random","_id":"unique-random@1.0.0","_shasum":"ce3e224c8242cd33a0e77b0d7180d77e6b62d0c4","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"ce3e224c8242cd33a0e77b0d7180d77e6b62d0c4","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-1.0.0.tgz","integrity":"sha512-K1sUkPf9EXCZFNIlMCoX4icAqcvkR4FMPH4Z61HbyiWhQl1ZGo0zYeV2bJmocK8Cp6tnKYrCnpkeKGebXZoRTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPkw5HQ4vM8Tky5+CEQcDcodPhuAXVRlJxTlIwDagSvAiEAnx9GawL9s/LVINpLMfJ8+ueatXaPydoXOF6Y19rnWLo="}]},"directories":{}},"2.0.0":{"name":"unique-random","version":"2.0.0","description":"Generate random numbers that are consecutively unique","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["unique","uniq","random","rand","number","single","generate","non-repeating","consecutively"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"65cac73dac0aca2888db93976914a023ae846bb4","bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random#readme","_id":"unique-random@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-yGRdXPklG5QZPPhNymq1it49PNtwO74/NHM1z243/FfvliDICgei1BSEC58yezEZ8U7YxfRcmstEuGruX0X1Jg==","shasum":"e502d9e2a8721921002ac40be28be3c80869d9f5","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-2.0.0.tgz","fileCount":4,"unpackedSize":3512,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmtZx9ldxM8kC1k5Z18adlQa5anHca03ReWxS4o6BL0AiBjxKzFrPAqV6xVvKM1MtZ0pdI5wEvvjzmicM6ytsBT7Q=="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random_2.0.0_1521781897147_0.4109740561702091"},"_hasShrinkwrap":false},"2.1.0":{"name":"unique-random","version":"2.1.0","description":"Generate random numbers that are consecutively unique","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["unique","random","number","single","generate","non-repeating","consecutively"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"e3c9fb9b3086839ee1dfc67751f7108d651cc137","bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random#readme","_id":"unique-random@2.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-iQ1ZgWac3b8YxGThecQFRQiqgk6xFERRwHZIWeVVsqlbmgCRl0PY13R4mUkodNgctmg5b5odG1nyW/IbOxQTqg==","shasum":"7a8413da5176d028567168b57125ac5c0cec5c25","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-2.1.0.tgz","fileCount":5,"unpackedSize":4082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsOk7CRA9TVsSAnZWagAAo8AQAI+t/IU0vEZVq3ULBX3E\n3lVUBInV79Rz7FWsx5h+bvfCA7XKCUmPaL/395nfCaZM+eStxAeHKPa2mFq6\n2PbWoGnSsccNI+nCeFXLp57r5c4AD+e854lkQlQg4MOvhcsW7/rtEHOEZd3l\nhgn7174yZMsSQohx3WaIESqcbUthPb4CFPmwczMCk/FK2nilDuIyqWVjptsA\nZIimpLwney8qpa8wCrT3VPrllFg4L9XFAbvJhiTu6EQQUIzhYpvcHi3lvAWN\njbJ4pfYK9T4cIzkjvACz9fx5iC3Oh1GLOS5yAQarFJA95lf6SwNTDmr/u5+b\n6N1xxRErmnY14cFdpYAdSpzCb4bN3AhfMGzGgWAkUnSjkZ9XxCODqoQPVqnA\nKciWqaMZnWddJPTwsKz1QV8LF+rhb11QIoJl5h3hfqNrouQpQA9j1SBtoT1k\nQq8BdaIipqZmdcaZ7YloZGJI2MSVo3q39guqbOZEOuBycqApmJN3YYLP6DHB\nmHXvlFNwJ+Q0mk0GJ+bLJcvA8OWLxXEF+5wpSPxTAz65+Y/NkLJcjqxXz1ER\ne/t0nmxaTuNrD75sUdgU5xHpev45CgIbG8MYpqzor3fxbmZc9McLQOABTXAE\nwM+FrX4M8qlF2Jw8tETC3BIVpZaKlqafkaaxVJ8mIvroN6aghPEgFzX3plZ9\nDcfX\r\n=VWhB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUjDgpq19WDs2DZRYZite/Erl5POOZiRPu8GZanrh7DwIhAPjvsQfCssjjjjsR0/HM8oKwZu94hDeb+BjL8DLzPZyk"}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random_2.1.0_1555097915157_0.14883356738253584"},"_hasShrinkwrap":false},"3.0.0":{"name":"unique-random","version":"3.0.0","description":"Generate random numbers that are consecutively unique","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random.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":["unique","random","number","single","generate","non-repeating","consecutively"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"e4dfe9653ac4e0faa87d5f941a22ecdf195d9a62","bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random#readme","_id":"unique-random@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-4vjtE3pH6xO5OmsSmjc6KPgHy2rbCw66BbMRLIyXkuq+WzOKA1oNkqQ+Y7Lh+sE0DrOrWMSpFkivhhzCF7J6HA==","shasum":"ddf20e62d2f5af1dbd606602fb5b5821588c8469","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-3.0.0.tgz","fileCount":5,"unpackedSize":3969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcFTsCRA9TVsSAnZWagAAStUP/Rjkd0ZVe9lMaeY4SGIM\nkXzikpmDVvSZUJVBoQ/nJZ+EWfcbCSWAd3CNs8Y/5k2q5X1QPuxPc8zIvRJx\nfy10dFz9z+3x4IfPQt5ukRQmHHLqi0KaaGTYa3/zzgEzpyfjpfJB7z2xrgQs\niiX5Lf0sLZOpQUjbCaAzTgKiactEsNzYazarIxpdm9t2of5nX6IcBP8Tb3Jr\ntLU1Kb0NPQC1R18jL4AFon6gnFL28aBpxh/JsQ/H54M+aPJfRFEYymdZA29T\nR8FJ4knumIDKHzlSxBFqbLRrj8DUeOKcJv8j9dBAJ75GcVeEdWn52kmTedl1\nUJme6pdQTcDfoXjjpZGS/E09iZGK5BZ6hZvY0zZSYwi4J1H8x0xAlo+iIvyz\nF3IHdc1/ogp/9xi9f2PHHT5J0AS65Ki+ZR4DQs8H1h75xyHbusF4qR5bnZit\nUP2P57GBrHtlgSUFGPN9GeSmy0U5plNObck6TY6T3GPrS6sBU5YnPiggjtLh\npvviTmvQ8MyZ9buzt1YQ4KqT+vLA6N9G6Vup5AURgAfdEAJBXiXw6TvGjMm8\n6XL0j+r2x/GLm2WCroE9yv8xdi8Ew/KcvRpVQFd9XmO0SBNwt78vC3F3+xtH\nYQ3Ri/6nSYtNQFv8vfZfbPBp8eIuyumdXIPZxMyFEQNsJrXq0T/cEAF9O1h2\ng1OR\r\n=/yKs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYbU0MYJ/ZM6uIxsGzNnQ3lQdCyiWVARwWjirxbl73eAiEAtYT9awP3V7d8OcHYpkBKLjSdc7aEfKV6WNYUO4HaIXk="}]},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random_3.0.0_1617974507689_0.1030595766715392"},"_hasShrinkwrap":false},"4.0.0":{"name":"unique-random","version":"4.0.0","description":"Generate random numbers that are consecutively unique","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https:/sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["unique","random","number","single","generate","non-repeating","consecutively","iterable","iterator","generator"],"devDependencies":{"ava":"^6.1.2","chalk":"^5.3.0","in-range":"^3.0.0","tsd":"^0.31.0","xo":"^0.58.0"},"types":"./index.d.ts","gitHead":"cf69fbd6eea4090d85217a9ca71e73b6c454fa24","bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"homepage":"https://github.com/sindresorhus/unique-random#readme","_id":"unique-random@4.0.0","_nodeVersion":"20.11.1","_npmVersion":"9.2.0","dist":{"integrity":"sha512-lrIvMDF5M9DOCy6j1YdNkMkAZkQAd0Bk7PWazA/Kr3cy2L0NhanxdeFmBFg+tDUirNHrIcQf3K7oIeBTCXpIFQ==","shasum":"878eaa1d78a13414bc874a32952325133fafdfae","tarball":"https://registry.npmjs.org/unique-random/-/unique-random-4.0.0.tgz","fileCount":5,"unpackedSize":7900,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOrWnpu6NSUdpj7TQ3LSiv1Gl3opL1vIrUOG+UQG3PywIgDuDjuPCAiynndB7bhbg1UV16MDBOIoFUh6jia6siVR0="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/unique-random_4.0.0_1712549495986_0.20739410796991065"},"_hasShrinkwrap":false}},"readme":"# unique-random\n\n> Generate random numbers that are consecutively unique\n\nUseful for things like slideshows where you don't want to have the same slide twice in a row.\n\n## Install\n\n```sh\nnpm install unique-random\n```\n\n## Usage\n\n```js\nimport {consecutiveUniqueRandom} from 'unique-random';\n\nconst random = consecutiveUniqueRandom(1, 10);\n\nconsole.log(random(), random(), random());\n//=> 5 2 6\n```\n\n## API\n\n### consecutiveUniqueRandom(minimum, maximum)\n\nGenerate random numbers that are consecutively unique, meaning that each number in the sequence is distinct from the one immediately before it.\n\n### exhaustiveUniqueRandom(minimum, maximum)\n\nGenerate random numbers that do not repeat until the entire range has appeared.\n\n### `consecutiveUniqueRandom` and `exhaustiveUniqueRandom`\n\nReturns a function, that when called, will return the generated number.\n\nThe returned function is also an iterable which consumes from the same source as the function:\n\n```js\nimport {exhaustiveUniqueRandom} from 'unique-random';\n\nconst random = exhaustiveUniqueRandom(1, 10);\n\nfor (const number of random) {\n\tconsole.log(number);\n\n\t// The unique numbers will be iterated over infinitely\n\tif (stopCondition) {\n\t\tbreak;\n\t}\n}\n```\n\n> [!NOTE]\n> If `minimum` is equal to `maximum`, the same value will always be returned.\n\n## Related\n\n- [unique-random-array](https://github.com/sindresorhus/unique-random-array) - Get consecutively unique elements from an array\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-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-at-depth](https://github.com/Aweary/unique-random-at-depth) - This module with an optional depth argument\n- [crypto-random-string](https://github.com/sindresorhus/crypto-random-string) - Generate a cryptographically strong random string\n","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"time":{"modified":"2024-04-08T04:11:36.308Z","created":"2013-11-13T20:19:43.537Z","0.1.0":"2013-11-13T20:20:07.699Z","0.1.1":"2014-04-29T19:44:46.702Z","1.0.0":"2014-08-13T19:25:09.527Z","2.0.0":"2018-03-23T05:11:37.255Z","2.1.0":"2019-04-12T19:38:35.275Z","3.0.0":"2021-04-09T13:21:47.805Z","4.0.0":"2024-04-08T04:11:36.144Z"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https:/sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/unique-random.git"},"homepage":"https://github.com/sindresorhus/unique-random#readme","keywords":["unique","random","number","single","generate","non-repeating","consecutively","iterable","iterator","generator"],"bugs":{"url":"https://github.com/sindresorhus/unique-random/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"rocket0191":true,"gzg1500521074":true}}