{"id":17964817,"url":"https://github.com/tokenrove/granderl","last_synced_at":"2025-03-25T06:31:04.762Z","repository":{"id":57503120,"uuid":"50207827","full_name":"tokenrove/granderl","owner":"tokenrove","description":"Fast-and-loose PRNG NIF","archived":false,"fork":false,"pushed_at":"2023-10-26T15:01:03.000Z","size":807,"stargazers_count":8,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-19T09:40:42.447Z","etag":null,"topics":["erlang","library","nif","pcg","prng","rdrand","xorshift"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tokenrove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-01-22T21:12:03.000Z","updated_at":"2023-03-29T15:37:16.000Z","dependencies_parsed_at":"2023-01-30T04:45:30.913Z","dependency_job_id":"8f8bb4e0-88a2-41a2-b479-272b3c27a149","html_url":"https://github.com/tokenrove/granderl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fgranderl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fgranderl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fgranderl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenrove%2Fgranderl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokenrove","download_url":"https://codeload.github.com/tokenrove/granderl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245413632,"owners_count":20611350,"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":["erlang","library","nif","pcg","prng","rdrand","xorshift"],"created_at":"2024-10-29T12:08:52.815Z","updated_at":"2025-03-25T06:31:04.361Z","avatar_url":"https://github.com/tokenrove.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\n\nExperiments in fast \"random\" number generation for Erlang; though they\nhave the same interface as `rand:uniform/1`, think of them more like\n`phash2/2` with a timestamp -- not really random, but fast\n(hopefully).\n\nSpecifically, some of the PRNGs here use methods that are known to be\nbiased.  They are not suitably for any application which assumes\nuniformity.  They are also not guaranteed to produce uncorrelated\nstreams when used in parallel.\n\n# Building\n\nUse [rebar3](http://www.rebar3.org/).  To override the default\nimplementation choice, you can set the `IMPLEMENTATION` environment\nvariable:\n\n```\n$ IMPLEMENTATION=rdrand rebar3 compile\n```\n\n# Interface\n\nAll functions take an integer between 1 and 2\u003csup\u003e32\u003c/sup\u003e-1, and\nreturn an integer between 1 and the supplied integer, like\n`rand:uniform/1`.\n\n## `granderl:`\n\n### `uniform(N :: 1..4294967295) -\u003e 1..4294967295`\n\n# Implementations\n\n## `rdrand`\n\n32-bits of [`RDRAND`](https://en.wikipedia.org/wiki/RdRand).\n\n## `xorshift`\n\nMarsaglia's original\n[xorshift](https://en.wikipedia.org/wiki/Xorshift) (with no\nmultiplies), keeping state in thread-local storage.  Initialized on\nfirst call.\n\n## `pcg32`\n\n[PCG](http://www.pcg-random.org), TLS.\n\n## `msws`\n\nMiddle Square Weyl Sequence, keeping state in thread-local storage.\nInitialized on first call.\n\n# References\n\nFog, Agner. [\"Pseudo-Random Number Generators for Vector Processors and Multicore Processors.\"](http://orbit.dtu.dk/ws/files/118886115/Fog_Pseudo_Random_Number_Generators.pdf) Journal of Modern Applied Statistical Methods 14.1 (2015): 308-334.\n\nMarsaglia, George. [\"Xorshift RNGs.\"](http://www.jstatsoft.org/article/view/v008i14) Journal of Statistical Software 8.14 (2003): 1-6.\n\nO'Neill, M.E. [\"PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation\"](http://www.pcg-random.org/pdf/toms-oneill-pcg-family-v1.02.pdf).\n\nWidynsky, Bernard. [\"Middle Square Weyl Sequence RNG\"](https://arxiv.org/pdf/1704.00358.pdf).\n\n# License\n\nBecause the pcg32 code is derived from Apache-licensed code (see\nc_src/pcg32.c), this package is also\n[Apache licensed](http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenrove%2Fgranderl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokenrove%2Fgranderl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenrove%2Fgranderl/lists"}