{"_id":"secure-sample","_rev":"10-6990f57cc78940fd809d80cd97b239df","name":"secure-sample","description":"Secure, sequential (n, N) sampling without replacement","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"secure-sample","version":"1.0.0","description":"Secure, sequential (n, N) sampling","main":"index.js","dependencies":{"secure-random-uniform":"^1.0.1"},"devDependencies":{"tape":"^4.6.2"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/secure-sample.git"},"keywords":["secure","crypto","sample","sequential","knuth"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/secure-sample/issues"},"homepage":"https://github.com/emilbayes/secure-sample#readme","gitHead":"cc93260b433eec709ad20efe3f5fe96507d73294","_id":"secure-sample@1.0.0","_shasum":"9d29637d0136d6c7a2224f1803ad135a18513539","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"emilbay","email":"github@tixz.dk"},"dist":{"shasum":"9d29637d0136d6c7a2224f1803ad135a18513539","tarball":"https://registry.npmjs.org/secure-sample/-/secure-sample-1.0.0.tgz","integrity":"sha512-KopkU5SaMXv726LLE42kbJEmeWKI+SbyN9uWXPUNX96mFtx8ldxyZyIC9UHy1KZuW7FrQjdRVBppt5zTYjiPnQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIESYyDVdidokHsnB9cUmhgl/WT+pAEgjMsTZ+pHKrVilAiEAlg+eFFuR9lGZ4i+KsK6v2jEfFkp7Xm1B8yXhAC2Am5w="}]},"maintainers":[{"name":"emilbay","email":"github@tixz.dk"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/secure-sample-1.0.0.tgz_1477887499480_0.2581197570543736"},"directories":{}},"1.0.1":{"name":"secure-sample","version":"1.0.1","description":"Secure, sequential (n, N) sampling","main":"index.js","dependencies":{"secure-random-uniform":"^1.0.1"},"devDependencies":{"tape":"^4.6.2"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/secure-sample.git"},"keywords":["secure","crypto","sample","sequential","knuth"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/secure-sample/issues"},"homepage":"https://github.com/emilbayes/secure-sample#readme","gitHead":"553ad2c6ca38c6957b4f4ca96ecaa78f192228b6","_id":"secure-sample@1.0.1","_shasum":"bd6ff46af228f2c4f886534843c08efbe47ee569","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"emilbay","email":"github@tixz.dk"},"dist":{"shasum":"bd6ff46af228f2c4f886534843c08efbe47ee569","tarball":"https://registry.npmjs.org/secure-sample/-/secure-sample-1.0.1.tgz","integrity":"sha512-pvJ4rCtGaEnEjiQ3psN5hguOprQBmzIThmUZdmO6oFwrxoB+GM1JaYNCPKUaG32nINioNi3PZ0BHKAn0UprzFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqTvHrS5VU8CJPmokZV30NMMjHhSmPc/wADElo4HnogAIhAMUHvOqcSAU3q3brK3jPvu4PfdEQ6/2beHzdzB4k10Gq"}]},"maintainers":[{"name":"emilbay","email":"github@tixz.dk"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/secure-sample-1.0.1.tgz_1477887703486_0.29323254176415503"},"directories":{}},"1.0.2":{"name":"secure-sample","version":"1.0.2","description":"Secure, sequential (n, N) sampling without replacement","main":"index.js","dependencies":{"secure-random-uniform":"^1.0.1"},"devDependencies":{"tape":"^4.6.2"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/secure-sample.git"},"keywords":["secure","crypto","sample","sequential","knuth"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/secure-sample/issues"},"homepage":"https://github.com/emilbayes/secure-sample#readme","gitHead":"fadb1a926fed344b47ac77b0b7c90057d750104b","_id":"secure-sample@1.0.2","_shasum":"9a4b36773a368984ac7f704bb335cf1a976f52e1","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"emilbay","email":"github@tixz.dk"},"dist":{"shasum":"9a4b36773a368984ac7f704bb335cf1a976f52e1","tarball":"https://registry.npmjs.org/secure-sample/-/secure-sample-1.0.2.tgz","integrity":"sha512-5fIIIny6G8T7gbRxrVayq7KkZUAiON3SlF98Xru6PhsLhwWv5sKz8YyT3L7wgfNduYJb9O/k1L2FPInKwCCbBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgSj9lwZF6SjT+SUWMUzS056N6Q60rNu2rFhVP950QCAiEAh46c3Z+qX2ORwR25Sffg+V1pdrQtW7Y8oafnznbdbzI="}]},"maintainers":[{"name":"emilbay","email":"github@tixz.dk"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/secure-sample-1.0.2.tgz_1477888426658_0.3039560941979289"},"directories":{}},"1.0.3":{"name":"secure-sample","version":"1.0.3","description":"Secure, sequential (n, N) sampling without replacement","main":"index.js","dependencies":{"nanoassert":"^1.1.0","secure-random-uniform":"^3.0.1"},"devDependencies":{"tape":"^4.6.2"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/secure-sample.git"},"keywords":["secure","crypto","sample","sequential","knuth"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/secure-sample/issues"},"homepage":"https://github.com/emilbayes/secure-sample#readme","gitHead":"9f393c8cce8d078a14575699b3690987069ddac3","_id":"secure-sample@1.0.3","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"emilbayes","email":"github@tixz.dk"},"dist":{"integrity":"sha512-ps5Vij3/L8Pvak1sIYVyAWUIjcNCl3iLncOZB4KvtIzmVcsa+YK8lkHeABcf2+jDaZwvCqd9b7dUZR5xgLxF/w==","shasum":"285cecfa1f2d4bead1426edef569800f513dc6ea","tarball":"https://registry.npmjs.org/secure-sample/-/secure-sample-1.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbUyxum0libWBMA4/0tRp+FizmJ8+AdisylabBMH4Q+AiEA7bCPYMB4JCT4gYtGQDbZbj2hadfJAwW4CDEK0GrA1GI="}]},"maintainers":[{"email":"github@tixz.dk","name":"emilbayes"},{"email":"github@tixz.dk","name":"emilbay"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/secure-sample-1.0.3.tgz_1515163706041_0.8274920941330492"},"directories":{}},"2.0.0":{"name":"secure-sample","version":"2.0.0","description":"Secure, sequential (n, N) sampling without replacement","main":"index.js","dependencies":{"nanoassert":"^2.0.0","secure-random-uniform":"^4.0.0"},"devDependencies":{"tape":"^5.0.0"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/emilbayes/secure-sample.git"},"keywords":["secure","crypto","sample","sequential","knuth"],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/secure-sample/issues"},"homepage":"https://github.com/emilbayes/secure-sample#readme","gitHead":"5bc4b4efb43fb568034697ea229a48a9bda67ffa","_id":"secure-sample@2.0.0","_nodeVersion":"12.16.2","_npmVersion":"6.14.4","dist":{"integrity":"sha512-oN0BKwTirBrnKf8wXMyPQKsemy6zDtQyJkM95Q5S1Mz3Z1jLLzfscEhIKCkbzlk8DehSI2ZQolINYYDiXyPusw==","shasum":"49480d44ea9559c716246cc6e1c66cfd7a7ea1d2","tarball":"https://registry.npmjs.org/secure-sample/-/secure-sample-2.0.0.tgz","fileCount":5,"unpackedSize":4461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJez3olCRA9TVsSAnZWagAADXMQAIJOA6Vz2hkmsR++JTPt\n9YqCrFBZVW09XEzMKTnTAdRDEUb2pyEn4oLKd/0K7G9LufoJelLxMAsflIcM\nlEGoOnVTzMe/ZITyUmPJZEpcehqmdtVWcbpZ6qogcI3lg/64zUqGPspusKqH\n4wckrWS0jG8ulhqbg5EJwWI4QIwaSXRttLwUAxeOKcdo01gok7OM43Ip8hbC\nFbI/L7FkyIIAsHfB2JLRL3G/oakpDO0EeQmxw5DnKQIfrhn8YIvWPXM1ofPQ\nfNYbnJyMmYVQzclbT1qcUBIdx6tmngCT0dTZc2iJLfW68nHsJ7jQrfMfzhtC\nVe6EYrgpYvfP5SH4q9tl3NfMU+x5GUHCPMncNwpnb8CA815YuwJyGSN/8oju\nfF/glSdo4esasmW34cA2LzCzbo4mIcuEt+Ra5DsFPniHTej+/278uhFcUpMQ\nT5KedSTb0oJn9OSTcgyapbeu79ukX2fJ+ofwvsWVxFkvwLdtPhkoAcNNJPQD\ntW1gDYEub5RfcRI8YCSMhK5t6W8kFI4kl//z/IRCD2S4p3EXUhMx0ci5z93e\nBN5yDGeRXmmzMkM1sl+qafvDjIoAf8Da77aANHVlJ10ijJc/a5tIuE7TJ6W5\nrOrugMrNIibMhO0rRigUTrwLfO6Q1Ar3oLY67XmJ158vCveG53tFYa9IA7+H\nrXu0\r\n=mZgQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHpryNnV60uuYurNJw2MPrKIJ/Z80dcnCxoGfku/lz97AiEA1F35gc0nKtsJgA16+xh954USfy80v4l3z3OlO0FAxig="}]},"maintainers":[{"email":"github@tixz.dk","name":"emilbay"},{"email":"github@tixz.dk","name":"emilbayes"}],"_npmUser":{"name":"emilbayes","email":"github@tixz.dk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/secure-sample_2.0.0_1590655524791_0.8772328222531933"},"_hasShrinkwrap":false}},"readme":"# `secure-sample`\n\n> Secure, sequential (n, N) sampling without replacement\n\n## Usage\n\n```js\nvar sample = require('secure-sample')\n\nsample(3, 10) // [0, 5, 9]\n\n```\n\nRandom order sample:\n\n```js\nvar sample = require('secure-sample')\nvar shuffle = require('secure-shuffle')\n\nshuffle(sample(3, 10)) // [6, 2, 8]\n\n```\n\n## API\n\n### `secureSample(sampleSize, populationSize)`\n\nWill return an array with `sampleSize` number of unique samples from the uniform\ndistribution `[0, populationSize)` (`populationSize` exclusive). The samples\nwill be sequential, so you may want to shuffle them. See [Related](#related) for\nrelevant module.\n\n`sampleSize` and `populationSize` must be safe integers. `sampleSize` must not be\nlarger than `populationSize`. If any of these conditions are violated, an error\nwill be thrown. Something like [`unassertify`](https://github.com/twada/unassertify)\n\n## Install\n\n```sh\nnpm install secure-shuffle\n```\n\n## Related\n\n* [`secure-random-uniform`](https://github.com/emilbayes/secure-random-uniform): Generate secure, random, uniform integers, compensating for modulo bias\n* [`secure-shuffle`](https://github.com/emilbayes/secure-shuffle): Shuffle an array using `secure-random-uniform` as the RNG\n\n## Reference\n\n[John D. Cook on Stack Overflow](http://stackoverflow.com/a/311716)\n\n## License\n\n[ISC](LICENSE.md)\n","maintainers":[{"email":"github@tixz.dk","name":"emilbay"},{"email":"github@tixz.dk","name":"emilbayes"}],"time":{"modified":"2022-06-26T17:14:23.324Z","created":"2016-10-31T04:18:19.693Z","1.0.0":"2016-10-31T04:18:19.693Z","1.0.1":"2016-10-31T04:21:45.084Z","1.0.2":"2016-10-31T04:33:48.386Z","1.0.3":"2018-01-05T14:48:26.973Z","2.0.0":"2020-05-28T08:45:24.931Z"},"homepage":"https://github.com/emilbayes/secure-sample#readme","keywords":["secure","crypto","sample","sequential","knuth"],"repository":{"type":"git","url":"git+https://github.com/emilbayes/secure-sample.git"},"author":{"name":"Emil Bay","email":"github@tixz.dk"},"bugs":{"url":"https://github.com/emilbayes/secure-sample/issues"},"license":"ISC","readmeFilename":"README.md"}