{"id":30021930,"url":"https://github.com/kimmyxpow/yurandom","last_synced_at":"2025-08-06T03:40:30.563Z","repository":{"id":304934916,"uuid":"1020592273","full_name":"kimmyxpow/yurandom","owner":"kimmyxpow","description":"A lightweight, deterministic PRNG (pseudo-random number generator) based on Xoroshiro128+, designed for consistent randomness in avatars, games, testing, and procedural generation.","archived":false,"fork":false,"pushed_at":"2025-07-16T06:05:13.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T08:17:29.558Z","etag":null,"topics":["deterministic","prng","pseudo-random","random","rng","seed","seeded-random","xoroshiro"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/yurandom","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/kimmyxpow.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T05:37:40.000Z","updated_at":"2025-07-16T06:05:17.000Z","dependencies_parsed_at":"2025-07-17T13:04:01.991Z","dependency_job_id":"3da189f9-9f15-4b25-a5aa-439a29ddf9f2","html_url":"https://github.com/kimmyxpow/yurandom","commit_stats":null,"previous_names":["kimmyxpow/yurandom"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kimmyxpow/yurandom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmyxpow%2Fyurandom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmyxpow%2Fyurandom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmyxpow%2Fyurandom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmyxpow%2Fyurandom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimmyxpow","download_url":"https://codeload.github.com/kimmyxpow/yurandom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimmyxpow%2Fyurandom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269016188,"owners_count":24345153,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["deterministic","prng","pseudo-random","random","rng","seed","seeded-random","xoroshiro"],"created_at":"2025-08-06T03:40:29.899Z","updated_at":"2025-08-06T03:40:30.521Z","avatar_url":"https://github.com/kimmyxpow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## yurandom ![NPM Downloads](https://img.shields.io/npm/dm/yurandom?style=flat-square) ![NPM Version](https://img.shields.io/npm/v/yurandom?style=flat-square)\n\nA deterministic, seed-based pseudo-random generator powered by Xoroshiro128+, with zero dependencies.\n\n### 📦 Features\n\n- 🔁 Deterministic output — same seed always gives same result\n- ⚡ Lightweight and fast — no dependencies\n- 🛠️ Includes common utilities: pick, shuffle, color, uuid, date, etc.\n- 🧪 Ideal for testing, generation, and reproducible randomness\n\n### 🚀 Installation\n\n```bash\nbun add yurandom\n# or\nnpm install yurandom\n# or\npnpm add yurandom\n```\n\n### ✅ Usage\n\n```js\nimport { Yurandom } from \"yurandom\";\n\nconst rng = new Yurandom(\"uwu\");\n\nrng.random(); // 0.00013223936797143612\nrng.int(1, 10); // 2\nrng.pick([\"a\", \"b\", \"c\"]); // a\nrng.bool(); // false\nrng.uuid(); // 29457443-6c0b-7e8f-5d81-0c0f3357962e\nrng.pastel(); // hsl(164, 70%, 85%)\n```\n\n### 📘 API\n\n| Method                  | Description                                  |\n| ----------------------- | -------------------------------------------- |\n| `random()`              | Float between 0 and 1                        |\n| `int(min, max)`         | Integer between min and max (inclusive)      |\n| `bool()`                | Boolean (`true` or `false`)                  |\n| `pick(arr)`             | Pick one item from array                     |\n| `shuffle(arr)`          | Shuffle array (non-mutating)                 |\n| `pastel()`              | Random pastel HSL color                      |\n| `range(n, min, max)`    | Array of `n` integers between min and max    |\n| `uuid()`                | UUID-like deterministic string               |\n| `date(start, end)`      | Random date between start and end            |\n| `weighted([[x,w],...])` | Pick based on weight                         |\n| `string(len, charset)`  | Random string                                |\n| `hex(bytes)`            | Hex string of given byte length              |\n| `color(format)`         | Random color in `\"hex\"`, `\"rgb\"`, or `\"hsl\"` |\n\n### 🎯 Real World Use Cases\n\n- **Avatar generators**: Create unique, consistent visuals (e.g., Dicebear-style avatars) from usernames or IDs.\n- **Game development**: Reproduce map layouts, item drops, or enemy patterns based on a seed.\n- **Testing tools**: Generate deterministic mock data for snapshot testing or simulations.\n- **User personalization**: Assign consistent themes, colors, or avatars to users without storing preferences.\n- **Fuzz testing**: Create predictable test variations with controlled randomness.\n- **Data generation**: Populate dev/staging environments with repeatable random data.\n\n### 🔒 Deterministic by Design\n\nAll randomness is based on your input seed and powered by [Xoroshiro128+](https://prng.di.unimi.it/xoroshiro128plus.c). This means results are 100% repeatable, even if your code runs next year, next decade, or after World War 3. As long as the seed is the same, the result will never change. Not even a meteor strike or a global reset button can stop it.\n\n### 🧪 Run Tests\n\n```bash\nbun test\n```\n\n### 📄 License\n\n[MIT](./LICENSE) – free for personal and commercial use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimmyxpow%2Fyurandom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimmyxpow%2Fyurandom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimmyxpow%2Fyurandom/lists"}