{"id":16906016,"url":"https://github.com/chocobo1/osrandom","last_synced_at":"2026-05-11T09:21:59.978Z","repository":{"id":86429436,"uuid":"127105233","full_name":"Chocobo1/OSRandom","owner":"Chocobo1","description":"C++11 Header-only CSPRNG layer","archived":false,"fork":false,"pushed_at":"2018-04-19T17:07:52.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T15:24:07.535Z","etag":null,"topics":["cpp","cpp11","header-only","random"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Chocobo1.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":"2018-03-28T07:59:45.000Z","updated_at":"2024-06-13T15:15:29.000Z","dependencies_parsed_at":"2023-07-13T16:31:00.342Z","dependency_job_id":null,"html_url":"https://github.com/Chocobo1/OSRandom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FOSRandom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FOSRandom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FOSRandom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chocobo1%2FOSRandom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chocobo1","download_url":"https://codeload.github.com/Chocobo1/OSRandom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244647910,"owners_count":20487162,"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":["cpp","cpp11","header-only","random"],"created_at":"2024-10-13T18:40:33.917Z","updated_at":"2026-05-11T09:21:59.912Z","avatar_url":"https://github.com/Chocobo1.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OSRandom [![TravisCI_badge]][TravisCI_link] [![AppVeyor_badge]][AppVeyor_link]\n\n[TravisCI_badge]: https://travis-ci.org/Chocobo1/OSRandom.svg?branch=master\n[TravisCI_link]: https://travis-ci.org/Chocobo1/OSRandom\n[AppVeyor_badge]: https://ci.appveyor.com/api/projects/status/github/Chocobo1/OSRandom?branch=master\u0026svg=true\n[AppVeyor_link]: https://ci.appveyor.com/project/Chocobo1/OSRandom\n\nC++11 header-only OS Random Layer\n\nA header-only random layer that expose cryptographically secure pseudorandom number generators (CSPRNG) provided by OS:\n* Windows: [MSDN](https://msdn.microsoft.com/en-us//library/windows/desktop/aa387694(v=vs.85).aspx)\n* Linux: [man7](http://man7.org/linux/man-pages/man4/random.4.html)\n* FreeBSD: [man](https://www.freebsd.org/cgi/man.cgi?query=random\u0026sektion=4)\n\n## Prerequisites\n* Linux, *nix, BSD ...\n  * C++11 compiler\n  * `/dev/random` is available to read\u003cbr /\u003e\n    This means API will block when there are not enough entropy in system\n* Windows\n  * C++11 compiler\n  * Warning: `NOMINMAX` is already defined and included before Windows.h header\u003cbr /\u003e\n    I.e. If you include Windows.h before this library, make sure `NOMINMAX` is defined before Windows.h\n* Run tests\n  * [doctest C++ testing framework](https://github.com/onqtam/doctest)\n\n\n## Usage\nTo use this header in your project:\n\n1. [Download osrandom.hpp](https://raw.githubusercontent.com/Chocobo1/OSRandom/master/osrandom.hpp)\n\n2. Use it like:\n    ```c++\n    #include \u003crandom\u003e\n    #include \"osrandom.hpp\"\n\n    void example()\n    {\n      // Specify distribution of outputs\n      std::uniform_int_distribution\u003c\u003e dist;\n\n      // Get an instance...\n      Chocobo1::OSRandom osRandom;\n\n      // Voilà!\n      int number = dist(osRandom);\n\n      // Or you prefer accessing it directly\n      int number2 = osRandom();\n    }\n    ```\n\n\n## Run Tests\nTo run tests, execute:\n```shell\ngit submodule update --init --remote --recursive\n\ncd test\n\n# linux\nmake\n./run_tests\n\n# Windows\nbuild.bat\nrun_tests.exe\n```\n\n\n## License\nSee [LICENSE](./LICENSE) file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchocobo1%2Fosrandom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchocobo1%2Fosrandom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchocobo1%2Fosrandom/lists"}