{"_id":"@1fun-oss/rng","_rev":"2-6edac8d91d254945c64957c50a11e8a5","name":"@1fun-oss/rng","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@1fun-oss/rng","version":"1.0.0","keywords":["igaming-certification","gaming-laboratories-international","gaminglabs","itech-labs","gli-19","csprng","rng","hmac-drbg"],"author":{"name":"1fun provider ltd"},"license":"MIT","_id":"@1fun-oss/rng@1.0.0","maintainers":[{"name":"1fun","email":"tech@1fun.games"}],"homepage":"https://github.com/1fun-games/rng#readme","bugs":{"url":"https://github.com/1fun-games/rng/issues"},"dist":{"shasum":"76017f97fa8bfdf73dd0da0fe56ac971a075df02","tarball":"https://registry.npmjs.org/@1fun-oss/rng/-/rng-1.0.0.tgz","fileCount":37,"integrity":"sha512-9r6upswZWKja4OIyXmWVXHIqQSiXf0hyFTcLGrSTjCiibbeZxbv+2hbzaFNxAWTwnn8EaT13HRu6ssQyyIxdKw==","signatures":[{"sig":"MEYCIQDi2j44lIlHibXyz707Fj3vI6EpuOzikH55UO05wQtZcwIhAKYFB1gJ71QuW+xscZWWGrguAyjCiXRmccGBFk6lrrGa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34277},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"c0833f625de13af290f2e18f38ed22e12218391e","scripts":{"lint":"eslint --ext .ts,.js,.mjs,mts .","test":"jest","build":"rimraf dist && tsc --build tsconfig.json","lint:fix":"eslint --ext .ts,.js,.mjs,mts . --fix"},"_npmUser":{"name":"1fun","email":"tech@1fun.games"},"repository":{"url":"git+https://github.com/1fun-games/rng.git","type":"git"},"_npmVersion":"10.9.4","description":"This repository implements a cryptographically secure Random Number Generator (RNG) built on **HMAC-DRBG** (Deterministic Random Bit Generator).","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"jest":"~30.1.3","yargs":"~18.0.0","eslint":"~9.35.0","expect":"~30.1.2","rimraf":"~6.0.1","ts-jest":"~29.4.1","ts-node":"~10.9.2","@eslint/js":"~9.35.0","typescript":"~5.9.2","@types/jest":"~30.0.0","@types/node":"~24.3.1","@types/yargs":"~17.0.33","@eslint/compat":"~1.3.2","@eslint/eslintrc":"~3.3.1","eslint-plugin-import":"~2.32.0","eslint-config-prettier":"~10.1.8","eslint-plugin-prettier":"~5.5.4","@typescript-eslint/parser":"~8.43.0","@typescript-eslint/eslint-plugin":"~8.43.0","eslint-import-resolver-typescript":"~4.4.4"},"_npmOperationalInternal":{"tmp":"tmp/rng_1.0.0_1768802043276_0.1071254589944921","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@1fun-oss/rng","version":"1.0.1","license":"MIT","author":{"name":"1fun provider ltd"},"keywords":["igaming-certification","gaming-laboratories-international","gaminglabs","itech-labs","gli-19","csprng","rng","hmac-drbg"],"homepage":"https://github.com/1fun-oss/rng#readme","repository":{"type":"git","url":"git+https://github.com/1fun-oss/rng.git"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"rimraf dist && tsc --build tsconfig.json","lint":"eslint --ext .ts,.js,.mjs,mts .","lint:fix":"eslint --ext .ts,.js,.mjs,mts . --fix","test":"jest"},"devDependencies":{"@eslint/compat":"~1.3.2","@eslint/eslintrc":"~3.3.1","@eslint/js":"~9.35.0","@types/jest":"~30.0.0","@types/node":"~24.3.1","@types/yargs":"~17.0.33","@typescript-eslint/eslint-plugin":"~8.43.0","@typescript-eslint/parser":"~8.43.0","eslint":"~9.35.0","eslint-config-prettier":"~10.1.8","eslint-import-resolver-typescript":"~4.4.4","eslint-plugin-import":"~2.32.0","eslint-plugin-prettier":"~5.5.4","expect":"~30.1.2","jest":"~30.1.3","rimraf":"~6.0.1","ts-jest":"~29.4.1","ts-node":"~10.9.2","typescript":"~5.9.2","yargs":"~18.0.0"},"_id":"@1fun-oss/rng@1.0.1","gitHead":"bcbadbee27459b307af196dd738462830bba61c9","description":"This repository implements a cryptographically secure Random Number Generator (RNG) built on **HMAC-DRBG** (Deterministic Random Bit Generator).","bugs":{"url":"https://github.com/1fun-oss/rng/issues"},"_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-n27Vrwg2QiPokAHeIgyCzmSKEKK3gRwkGKTDB3EithU7ABmgCkWh8wlGLQHBVEwPG/lPKtprxVxOkRN9X5y7uQ==","shasum":"5d9b20c11012d731b7ae9d71c9ae7ebaa7a8a0bd","tarball":"https://registry.npmjs.org/@1fun-oss/rng/-/rng-1.0.1.tgz","fileCount":37,"unpackedSize":34307,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFVjKCJeXO/6xtLce8rYqcHKAdN6Q2qxq3CKS7+kqRrrAiAu5y6z/07xrXFJ8YhMuXB6Ln1X5NJvaHtlInqqPflYdQ=="}]},"_npmUser":{"name":"1fun","email":"tech@1fun.games"},"directories":{},"maintainers":[{"name":"1fun","email":"tech@1fun.games"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rng_1.0.1_1768836829996_0.3972925428282561"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-19T05:54:03.205Z","modified":"2026-01-19T15:33:50.289Z","1.0.0":"2026-01-19T05:54:03.416Z","1.0.1":"2026-01-19T15:33:50.120Z"},"bugs":{"url":"https://github.com/1fun-oss/rng/issues"},"author":{"name":"1fun provider ltd"},"license":"MIT","homepage":"https://github.com/1fun-oss/rng#readme","keywords":["igaming-certification","gaming-laboratories-international","gaminglabs","itech-labs","gli-19","csprng","rng","hmac-drbg"],"repository":{"type":"git","url":"git+https://github.com/1fun-oss/rng.git"},"description":"This repository implements a cryptographically secure Random Number Generator (RNG) built on **HMAC-DRBG** (Deterministic Random Bit Generator).","maintainers":[{"name":"1fun","email":"tech@1fun.games"}],"readme":"# GLI-19 Compliant Cryptographically Secure Pseudo Random Number Generator (RNG)\n\nThis repository implements a cryptographically secure Random Number Generator (RNG) built on **HMAC-DRBG** (Deterministic Random Bit Generator).  \n\nThe project follows the technical requirements from [GLI-19 Chapter 3: Random Number Generator (RNG) Requirements](https://gaminglabs.com/gli-standards/).\n\nThis implementation is designed as production-ready RNG code and can be submitted for **GLI / iTech Labs certification**.\n\n\n## Structure\n- `cli` - CLI tools for generating test data\n- `examples` - Example usage of the RNG\n- `src/hmac-drbg` - HMAC-DRBG implementation\n- `src/rng` - Shuffling, scaling and draw utilities\n- `src/utils` - Some helpful utilities\n\n\n## Dieharder Docker\nThis project includes a Dockerfile with [dieharder](https://webhome.phy.duke.edu/~rgb/General/dieharder.php).\n\n```shell\ndocker build -t 1fun-rng .\ndocker run -it --rm 1fun-rng\n```\n\n> ⚠️ **Note on Dieharder Testing**  \n> Some statistical tests in the Dieharder suite are very data-hungry.  \n> To achieve a full **\"PASSED\"** status across all tests, a **large amount of RNG output data** may be required.  \n> This is expected behavior since certain tests need millions or even billions of samples to converge reliably.\n\n\n## Generate ASCII output to txt file for usage with dieharder\n\n```shell\nnpx ts-node ./cli/generate-dieharder-ascii.ts \\\n  --server-seed abcdefghijklmnopqrstuvwxyz \\\n  --client-seed abcdefghijklmnopqrstuvwxyz \\\n  --count 2684354560 \\\n  --destination data/hmac-dbrng.txt\n```\n\nThis creates a file `hmac-dbrng.txt` with 2 684 354 560 uint32 values generated with the HMAC-DRBG algorithm.\n\nIt can be used with the [dieharder](https://webhome.phy.duke.edu/~rgb/General/dieharder.php) test suite:\n```shell\ndieharder -g 202 -f data/hmac-dbrng.txt -a\n```\n\n\n## Generate raw output to bin file for usage with dieharder\n\n```shell\nnpx ts-node ./cli/generate-dieharder-bin.ts \\\n  --server-seed abcdefghijklmnopqrstuvwxyz \\\n  --client-seed abcdefghijklmnopqrstuvwxyz \\\n  --count 2684354560 \\\n  --destination data/hmac-dbrng.bin\n```\n\nThis creates a file `hmac-dbrng.bin` with 2 684 354 560 uint32 values (10GiB of data) generated with the HMAC-DRBG algorithm.\n\nIt can be used with the [dieharder](https://webhome.phy.duke.edu/~rgb/General/dieharder.php) test suite:\n```shell\ndieharder -g 201 -f data/hmac-dbrng.bin -a\n```\n\n\n## Generate output to txt file for GLI\n\n```shell\nnpx ts-node ./cli/generate-gli-output.ts \\\n  --server-seed abcdefghijklmnopqrstuvwxyz \\\n  --client-seed abcdefghijklmnopqrstuvwxyz \\\n  --range-start 1 \\\n  --range-end 52 \\\n  --selections 52 \\\n  --draws 100000 \\\n  --destination data/gli.txt\n```\n\nThe additional parameter `--with-replacements` allows for numbers to be repeated within selections.\n\n> range-start and range-end are inclusive\n\n\n## Acknowledgements\nThis project draws ideas and inspiration (and in some cases code concepts) from the following open-source projects:\n\n- [Mintablo/mintablo-rng](https://github.com/Mintablo/mintablo-rng)\n- [bcoin-org/bcrypto](https://github.com/bcoin-org/bcrypto)\n- [indutny/hmac-drbg](https://github.com/indutny/hmac-drbg)\n","readmeFilename":"README.md"}