{"id":20270934,"url":"https://github.com/mackron/cryptorand","last_synced_at":"2025-04-11T04:20:50.171Z","repository":{"id":145738530,"uuid":"456093744","full_name":"mackron/cryptorand","owner":"mackron","description":"Cryptographically Secure Pseudo-Random Number Generator.","archived":false,"fork":false,"pushed_at":"2022-04-07T11:24:16.000Z","size":23,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T02:36:41.131Z","etag":null,"topics":["random"],"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/mackron.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-06T08:20:07.000Z","updated_at":"2024-12-25T12:37:57.000Z","dependencies_parsed_at":"2023-06-01T00:45:52.067Z","dependency_job_id":null,"html_url":"https://github.com/mackron/cryptorand","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/mackron%2Fcryptorand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackron%2Fcryptorand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackron%2Fcryptorand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackron%2Fcryptorand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mackron","download_url":"https://codeload.github.com/mackron/cryptorand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248340140,"owners_count":21087393,"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":["random"],"created_at":"2024-11-14T12:35:00.842Z","updated_at":"2025-04-11T04:20:50.163Z","avatar_url":"https://github.com/mackron.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch4 align=\"center\"\u003eCryptographically Secure Pseudo-Random Number Generator\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/9vpqbjU\"\u003e\u003cimg src=\"https://img.shields.io/discord/712952679415939085?label=discord\u0026logo=discord\" alt=\"discord\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/mackron\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/mackron?style=flat\u0026label=twitter\u0026color=1da1f2\u0026logo=twitter\" alt=\"twitter\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis uses the operating system's random number generation. If you're looking for a CSPRNG from\nscratch you'll need to look elsewhere.\n\nSupported generation methods are Win32's BCryptGenRandom() with CryptGenRandom() as a fallback. On\nplatforms that support /dev/urandom, that will be used. OpenBSD will use arc4random().\n\nThere is no need to link to anything with this library. You can use CRYPTORAND_IMPLEMENTATION to\ndefine the implementation section, or you can use cryptorand.c if you prefer a traditional\nheader/source pair.\n\nThere's only three functions, all of which should be self explanatory and easy to figure out:\n\n    cryptorand_result cryptorand_init(cryptorand* pRNG);\n    void cryptorand_uninit(cryptorand* pRNG);\n    cryptorand_result cryptorand_generate(cryptorand* pRNG, void* pBufferOut, size_t byteCount);\n\nCall `cryptorand_init()` to initialize the random number generator. On Windows, this is where\nlibraries are linked at runtime so avoid calling this in high performance scenarios. It's best to\njust create one instance and then read from it multiple times.\n\nTo generate random bytes you need only call `cryptorand_generate()`. You just specify a pointer to\na buffer that will receive the random data and the number of bytes you want. If this fails, the\ncontent of the buffer will be cleared to zero.\n\nUninitialize the random number generator with `cryptorand_uninit()`.\n\nThread safety depends on the backend.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackron%2Fcryptorand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmackron%2Fcryptorand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackron%2Fcryptorand/lists"}