{"id":22793074,"url":"https://github.com/kripod/hmac-rng.js","last_synced_at":"2025-03-30T17:20:35.989Z","repository":{"id":57264641,"uuid":"49019710","full_name":"kripod/hmac-rng.js","owner":"kripod","description":"HMAC-based random number generator written in JavaScript.","archived":false,"fork":false,"pushed_at":"2016-03-06T16:52:59.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T11:43:17.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kripod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-04T20:00:04.000Z","updated_at":"2024-07-30T23:37:58.000Z","dependencies_parsed_at":"2022-08-25T02:52:09.318Z","dependency_job_id":null,"html_url":"https://github.com/kripod/hmac-rng.js","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2Fhmac-rng.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2Fhmac-rng.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2Fhmac-rng.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2Fhmac-rng.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kripod","download_url":"https://codeload.github.com/kripod/hmac-rng.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246351357,"owners_count":20763287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T03:17:55.284Z","updated_at":"2025-03-30T17:20:35.967Z","avatar_url":"https://github.com/kripod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hmac-rng\n\n[![Version (npm)](https://img.shields.io/npm/v/hmac-rng.svg)](https://npmjs.com/package/hmac-rng)\n[![Build Status](https://img.shields.io/travis/kripod/hmac-rng.js/master.svg)](https://travis-ci.org/kripod/hmac-rng.js)\n[![Code Coverage](https://img.shields.io/codeclimate/coverage/github/kripod/hmac-rng.js.svg)](https://codeclimate.com/github/kripod/hmac-rng.js/coverage)\n[![Code Climate](https://img.shields.io/codeclimate/github/kripod/hmac-rng.js.svg)](https://codeclimate.com/github/kripod/hmac-rng.js)\n\nHMAC-based random number generator written in JavaScript.\n\n## API Reference\n\n* [HmacRng](#module_HmacRng)\n    * [HmacRng](#exp_module_HmacRng--HmacRng) ⏏\n        * [new HmacRng(seed, [algorithm])](#new_module_HmacRng--HmacRng_new)\n        * _instance_\n            * [.nextInt(min, max)](#module_HmacRng--HmacRng+nextInt) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n            * [.nextInts(min, max, amount)](#module_HmacRng--HmacRng+nextInts) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n        * _static_\n            * [.defaultAlgorithm](#module_HmacRng--HmacRng.defaultAlgorithm)\n            * [.getRandomInt(seed, min, max)](#module_HmacRng--HmacRng.getRandomInt) ⇒ \u003ccode\u003enumber\u003c/code\u003e\n            * [.getRandomInts(seed, min, max, amount)](#module_HmacRng--HmacRng.getRandomInts) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\n            * [.shuffleArray(seed, array)](#module_HmacRng--HmacRng.shuffleArray) ⇒ \u003ccode\u003eArray.\u0026lt;Object\u0026gt;\u003c/code\u003e\n\n\u003ca name=\"exp_module_HmacRng--HmacRng\"\u003e\u003c/a\u003e\n### HmacRng ⏏\n**Kind**: Exported class  \n\u003ca name=\"new_module_HmacRng--HmacRng_new\"\u003e\u003c/a\u003e\n#### new HmacRng(seed, [algorithm])\nCreates a new HMAC-RNG instance.\n\n\n| Param | Type | Description |\n| --- | --- | --- |\n| seed | \u003ccode\u003estring\u003c/code\u003e | Seed used for randomization. |\n| [algorithm] | \u003ccode\u003estring\u003c/code\u003e | Cryptographic algorithm to use HMAC with. |\n\n\u003ca name=\"module_HmacRng--HmacRng+nextInt\"\u003e\u003c/a\u003e\n#### hmacRng.nextInt(min, max) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nGets the next random integer in the current sequence.\rThe maximum range of 'min' and 'max' is 2^28 (268435456).\n\n**Kind**: instance method of \u003ccode\u003e[HmacRng](#exp_module_HmacRng--HmacRng)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - The generated random integer.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| min | \u003ccode\u003enumber\u003c/code\u003e | Inclusive lower bound of the random integer returned. |\n| max | \u003ccode\u003enumber\u003c/code\u003e | Inclusive upper bound of the random integer returned. This must be greater than 'min'. |\n\n\u003ca name=\"module_HmacRng--HmacRng+nextInts\"\u003e\u003c/a\u003e\n#### hmacRng.nextInts(min, max, amount) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nGets the next random integers in the current sequence.\rThe maximum range of 'min' and 'max' is 2^28 (268435456).\n\n**Kind**: instance method of \u003ccode\u003e[HmacRng](#exp_module_HmacRng--HmacRng)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - The generated array of random integers.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| min | \u003ccode\u003enumber\u003c/code\u003e | Inclusive lower bound of the random integers returned. |\n| max | \u003ccode\u003enumber\u003c/code\u003e | Inclusive upper bound of the random integers returned. This must be greater than 'min'. |\n| amount | \u003ccode\u003enumber\u003c/code\u003e | Amount of integers to be generated. |\n\n\u003ca name=\"module_HmacRng--HmacRng.defaultAlgorithm\"\u003e\u003c/a\u003e\n#### HmacRng.defaultAlgorithm\nDetermines the default cryptographic algorithm to use HMAC with.\rUseful for altering the output of static methods.\n\n**Kind**: static property of \u003ccode\u003e[HmacRng](#exp_module_HmacRng--HmacRng)\u003c/code\u003e  \n\u003ca name=\"module_HmacRng--HmacRng.getRandomInt\"\u003e\u003c/a\u003e\n#### HmacRng.getRandomInt(seed, min, max) ⇒ \u003ccode\u003enumber\u003c/code\u003e\nGenerates a random integer using the default algorithm.\rThe maximum range of 'min' and 'max' is 2^28 (268435456).\n\n**Kind**: static method of \u003ccode\u003e[HmacRng](#exp_module_HmacRng--HmacRng)\u003c/code\u003e  \n**Returns**: \u003ccode\u003enumber\u003c/code\u003e - The generated random integer.  \n**Since**: 1.1.0  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| seed | \u003ccode\u003estring\u003c/code\u003e | Seed used for randomization. |\n| min | \u003ccode\u003enumber\u003c/code\u003e | Inclusive lower bound of the random integer returned. |\n| max | \u003ccode\u003enumber\u003c/code\u003e | Inclusive upper bound of the random integer returned. This must be greater than 'min'. |\n\n\u003ca name=\"module_HmacRng--HmacRng.getRandomInts\"\u003e\u003c/a\u003e\n#### HmacRng.getRandomInts(seed, min, max, amount) ⇒ \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e\nGenerates random integers using the default algorithm.\rThe maximum range of 'min' and 'max' is 2^28 (268435456).\n\n**Kind**: static method of \u003ccode\u003e[HmacRng](#exp_module_HmacRng--HmacRng)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eArray.\u0026lt;number\u0026gt;\u003c/code\u003e - The generated array of random integers.  \n**Since**: 1.1.0  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| seed | \u003ccode\u003estring\u003c/code\u003e | Seed used for randomization. |\n| min | \u003ccode\u003enumber\u003c/code\u003e | Inclusive lower bound of the random integers returned. |\n| max | \u003ccode\u003enumber\u003c/code\u003e | Inclusive upper bound of the random integers returned. This must be greater than 'min'. |\n| amount | \u003ccode\u003enumber\u003c/code\u003e | Amount of integers to be generated. |\n\n\u003ca name=\"module_HmacRng--HmacRng.shuffleArray\"\u003e\u003c/a\u003e\n#### HmacRng.shuffleArray(seed, array) ⇒ \u003ccode\u003eArray.\u0026lt;Object\u0026gt;\u003c/code\u003e\nShuffles the given array using the default algorithm.\n\n**Kind**: static method of \u003ccode\u003e[HmacRng](#exp_module_HmacRng--HmacRng)\u003c/code\u003e  \n**Returns**: \u003ccode\u003eArray.\u0026lt;Object\u0026gt;\u003c/code\u003e - The array which has been shuffled.  \n**Since**: 1.1.0  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| seed | \u003ccode\u003estring\u003c/code\u003e | Seed used for randomization. |\n| array | \u003ccode\u003eArray.\u0026lt;Object\u0026gt;\u003c/code\u003e | Array to be shuffled. |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkripod%2Fhmac-rng.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkripod%2Fhmac-rng.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkripod%2Fhmac-rng.js/lists"}