{"id":13812960,"url":"https://github.com/imneme/pcg-c","last_synced_at":"2026-01-10T12:52:40.621Z","repository":{"id":22050900,"uuid":"25379629","full_name":"imneme/pcg-c","owner":"imneme","description":"PCG — C Implementation","archived":false,"fork":false,"pushed_at":"2023-10-26T02:23:02.000Z","size":252,"stargazers_count":365,"open_issues_count":9,"forks_count":59,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-11-19T07:39:57.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imneme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE.txt","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":"2014-10-17T22:26:16.000Z","updated_at":"2024-11-12T12:53:12.000Z","dependencies_parsed_at":"2024-06-24T01:01:40.727Z","dependency_job_id":"e895ad22-6ba2-4a76-8e73-97e78eb70673","html_url":"https://github.com/imneme/pcg-c","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/imneme%2Fpcg-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imneme%2Fpcg-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imneme%2Fpcg-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imneme%2Fpcg-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imneme","download_url":"https://codeload.github.com/imneme/pcg-c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254239567,"owners_count":22037728,"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":[],"created_at":"2024-08-04T04:00:58.699Z","updated_at":"2026-01-10T12:52:40.552Z","avatar_url":"https://github.com/imneme.png","language":"C","funding_links":[],"categories":["Cryptography"],"sub_categories":["Random Number Generation"],"readme":"# PCG Random Number Generation, C Edition\n\n[PCG-Random website]: http://www.pcg-random.org\n\nThis code provides an implementation of the PCG family of random number\ngenerators, which are fast, statistically excellent, and offer a number of\nuseful features.\n\nFull details can be found at the [PCG-Random website].  This version\nof the code provides many family members -- if you just want one\nsimple generator, you may prefer the minimal version of the library.\n\nThere are two APIs, a low-level one which explicitly names the output\nfunctions, and a higher-level one (which maps directly to the low-level\ncode).  Generally, you should use the high-level API.\n\n## Documentation and Examples\n\nVisit [PCG-Random website] for information on how to use this library, or look\nat the sample code in the `sample` directory -- hopefully it should be fairly\nself explanatory.\n\n## Building\n\nThe code is written in C99-style C with no significant platform dependencies.\nOn a Unix-style system (e.g., Linux, Mac OS X) you should be able to just\ntype\n\n    make\n\nAlmost all the real code is in `include/pcg_variants.h`.  Because the\nindividual RNGs have a very small amount of code, they are provided as\ninline functions to allow the compiler the option of inlining them.\nBut because C requires there to also be an external definition, the\n`src` directory contains code to build `libpcg_random.a` which provides\nnon-inline definitions for all the PCG generators.\n\nOn other systems, it should be straightforward to build a library by\ncompiling the files in the src directory.  Or, write your own file giving\nan `extern` declaration for every function you actually use.\n\n## Testing\n\nRun\n\n    make test\n\n## Directory Structure\n\nThe directories are arranged as follows:\n\n* `include` -- contains `pcg_variants.h`\n* `src` -- code to define external versions of the inline functions from\n  `pcg_variants.h` plus all the `_advance_r` functions.\n* `test-low` -- test code for the low-level API where the functions have long\n  scary-looking names\n* `test-high` -- test code for the high-level API where the functions have\n  shorter, less scary-looking names.\n* `extras` -- other useful code, such as code to read /dev/random\n* `sample` -- sample code, similar to the code in `test-high` but more human\n  readable\n  \n## 128-bit Math\n\nOn systems that support it (64-bit systems using GCC or Clang), the library\nprovides RNGs that use 128-bit integer math. These generators produce 64-bit\noutput (or more) and have a period of 2^128.\n\nIf you don't have 128-bit support on your system, you aren't losing that much.\nThanks to the 2^63 random streams/sequences, you can gang together multiple\n32-bit generators.  (Note: This approach *would not work* well with generators\nthat only have a single stream/sequence).  Example code is provided in\n`sample/pcg32x2-demo.c`.\n\nThe C++ implementation provides 128-bit integers even on systems that don't\nnatively support it, but doing so would be too much trouble in C.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimneme%2Fpcg-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimneme%2Fpcg-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimneme%2Fpcg-c/lists"}