{"id":15160276,"url":"https://github.com/minavoii/unity-random","last_synced_at":"2026-03-07T03:32:33.697Z","repository":{"id":254306822,"uuid":"846175303","full_name":"minavoii/unity-random","owner":"minavoii","description":"A reimplementation of Unity's pseudo-random number generator.","archived":false,"fork":false,"pushed_at":"2024-08-23T16:20:52.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T00:01:30.016Z","etag":null,"topics":["prng","random","rng","rust","unity","unity-random"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/minavoii.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}},"created_at":"2024-08-22T17:13:41.000Z","updated_at":"2024-11-10T11:28:23.000Z","dependencies_parsed_at":"2025-02-09T20:32:17.194Z","dependency_job_id":"cea4ca1e-a83d-48ae-9d60-4ca48cd33d66","html_url":"https://github.com/minavoii/unity-random","commit_stats":null,"previous_names":["minavoii/unity-random"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/minavoii/unity-random","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minavoii%2Funity-random","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minavoii%2Funity-random/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minavoii%2Funity-random/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minavoii%2Funity-random/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minavoii","download_url":"https://codeload.github.com/minavoii/unity-random/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minavoii%2Funity-random/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["prng","random","rng","rust","unity","unity-random"],"created_at":"2024-09-26T22:43:34.081Z","updated_at":"2026-03-07T03:32:33.673Z","avatar_url":"https://github.com/minavoii.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity-Random\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-minavoii/unity--random-8da0cb?labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/minavoii/unity-random) [\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/unity-random.svg?color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/unity-random) [\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-unity--random-66c2a5?labelColor=555555\u0026logo=docs.rs\" height=\"20\"\u003e](https://docs.rs/unity-random)\n\nA full reimplementation of Unity's PRNG in Rust, which is based on the Xorshift128 algorithm.\n\nResults should be near 1-to-1 with Unity, with the exception of `color()` which may produce slightly inaccurate results due to an issue with .NET versions before 5.x.\n\nUnlike Unity, it does not offer a static class.\n\nNote: you should not use this if you expect a cryptographically secure PRNG. If you just want to generate random numbers, you should be looking into the [`Rand`](https://crates.io/crates/rand) crate.\n\nThis project is not affiliated with Unity Technologies.\n\n## Usage\n\n```rust\nuse unity_random::Random;\nlet mut random = Random::new();\nrandom.init_state(220824); // set the PRNG seed\n\nlet integer = random.range_int(0, 100);\nlet float = random.range_float(0., 1.);\nlet rotation = random.rotation_uniform();\n```\n\nYou can also save/load the current state:\n\n```rust\nuse unity_random::Random;\nlet mut random = Random::new();\nrandom.init_state(220824);\n\n// You can save the current state...\nlet saved_state = random.state;\n\n// then generate random numbers...\nlet i1 = random.range_int(0, 100);\n\n// and load the state again...\nrandom.state = saved_state;\n\n// ... to generate the same sequence\nlet i2 = random.range_int(0, 100);\nassert_eq!(i1, i2);\n```\n\n## Feature flags\n\n- `serde`: Enables serialization and deserialization of the PRNG's `State`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminavoii%2Funity-random","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminavoii%2Funity-random","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminavoii%2Funity-random/lists"}