{"id":18195825,"url":"https://github.com/yichengdwu/random123","last_synced_at":"2026-03-19T03:26:16.107Z","repository":{"id":245078913,"uuid":"817099572","full_name":"YichengDWu/random123","owner":"YichengDWu","description":"Splittable pseudorandom number generators","archived":false,"fork":false,"pushed_at":"2024-06-21T02:29:49.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T06:11:59.095Z","etag":null,"topics":["mojo"],"latest_commit_sha":null,"homepage":"","language":"Mojo","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/YichengDWu.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-06-19T02:51:52.000Z","updated_at":"2024-06-23T16:13:26.000Z","dependencies_parsed_at":"2024-06-21T21:00:17.286Z","dependency_job_id":null,"html_url":"https://github.com/YichengDWu/random123","commit_stats":null,"previous_names":["yichengdwu/random123"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YichengDWu/random123","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YichengDWu%2Frandom123","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YichengDWu%2Frandom123/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YichengDWu%2Frandom123/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YichengDWu%2Frandom123/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YichengDWu","download_url":"https://codeload.github.com/YichengDWu/random123/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YichengDWu%2Frandom123/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"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":["mojo"],"created_at":"2024-11-03T08:05:03.484Z","updated_at":"2026-01-19T09:02:00.167Z","avatar_url":"https://github.com/YichengDWu.png","language":"Mojo","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Random123\n\nRandom123 is a library of *splittable* pseudo random number generators. It follows [Jax's PRGN design](https://jax.readthedocs.io/en/latest/jep/263-prng.html).\n\n# Usage\n\n```mojo\nimport random123\nfrom random123 import PRNGKey\n\nvar key = random123.key(123)\nvar samples = random123.normal[DType.float32](key^, 1000)\n\nfn f(owned key: PRNGKey):\n    var newkey: PRNGKey\n    var subkey: PRNGKey\n    newkey, subkey = random123.split(key^, 2)\n    g(newkey^)\n    h(subkey^)\n```\n\nImplemented methods include `bits`, `uniform` and `normal`. More to come!\n\nNote that it is required to use the transfer operator `^` whenever using a `PRNGKey`, and `split` it into new keys if needed.\nOtherwise, you should make sure every key is only used once.\n\n# Benchmarks\n\nRandom123 is blazingly fast, thanks to the buildin SIMD vectors and `parallelize` in Mojo.\nHere is a comparison with Jax:\n\n![Benchmark Results](./benchmark_chart.png)\n\n\n# Heads-up\n\nYou might bump into a compiler bug with `DType.float16` or `DType.bfloat16`. \nSee the [issue](https://github.com/modularml/mojo/issues/3073#issue).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyichengdwu%2Frandom123","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyichengdwu%2Frandom123","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyichengdwu%2Frandom123/lists"}