{"id":16568685,"url":"https://github.com/drupol/yaroc","last_synced_at":"2025-10-29T00:31:55.272Z","repository":{"id":13457588,"uuid":"74487664","full_name":"drupol/yaroc","owner":"drupol","description":"YAROC: Yet Another Random.Org Client.","archived":false,"fork":false,"pushed_at":"2023-09-08T05:44:28.000Z","size":195,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T20:45:01.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://random.org/","language":"PHP","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/drupol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"drupol","custom":["https://www.paypal.me/drupol"]}},"created_at":"2016-11-22T15:43:21.000Z","updated_at":"2022-07-13T12:21:20.000Z","dependencies_parsed_at":"2024-10-11T21:21:41.712Z","dependency_job_id":null,"html_url":"https://github.com/drupol/yaroc","commit_stats":{"total_commits":110,"total_committers":4,"mean_commits":27.5,"dds":0.5454545454545454,"last_synced_commit":"13fc56a7f54c7c862c7ebd3ec5f033058e1640ec"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fyaroc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fyaroc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fyaroc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fyaroc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drupol","download_url":"https://codeload.github.com/drupol/yaroc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238751287,"owners_count":19524536,"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-10-11T21:11:22.292Z","updated_at":"2025-10-29T00:31:49.999Z","avatar_url":"https://github.com/drupol.png","language":"PHP","funding_links":["https://github.com/sponsors/drupol","https://www.paypal.me/drupol"],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version][latest stable version]][packagist]\n [![GitHub stars][github stars]][packagist]\n [![Total Downloads][total downloads]][packagist]\n [![GitHub Workflow Status][github workflow status]][github actions]\n [![Scrutinizer code quality][code quality]][scrutinizer code quality]\n [![Type Coverage][type coverage]][sheperd type coverage]\n [![Code Coverage][code coverage]][scrutinizer code quality]\n [![License][license]][packagist]\n [![Donate!][donate github]][github sponsor]\n [![Donate!][donate paypal]][paypal sponsor]\n\n## YAROC\n\nYet Another [Random.Org](https://random.org) Client.\n\nYAROC fully supports [V1](https://api.random.org/json-rpc/1/) and [V2](https://api.random.org/json-rpc/2) API.\n\nMost of the classes of this library are stateless and immutable.\n\n## Requirements\n\n* PHP \u003e= 7.4\n* An HTTP Client (see [symfony/http-client](https://github.com/symfony/http-client))\n\n## Installation\n\n```bash\ncomposer require drupol/yaroc\n```\n\nYAROC needs an HTTP client in order to work, do\n\n```bash\ncomposer require symfony/http-client\n```\n\nor provide one.\n\n## Usage\n\nFirst [request an API Key](https://api.random.org/api-keys) or use the temporary key.\n\n__The temporary API key used in the examples will be disabled when the beta ends.__\n\nYou can call [any API methods described in the documentation](https://api.random.org/json-rpc/1/basic) from [Random.org](https://random.org).\n\nCurrently support all the [Random.org](https://random.org) API method calls in the [basic](https://api.random.org/json-rpc/2/basic) and [signed](https://api.random.org/json-rpc/2/signed) APIs.\n\n## Examples\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse drupol\\Yaroc\\Plugin\\Provider;\nuse drupol\\Yaroc\\RandomOrgAPI;\n\n$generateIntegers = (new Provider())-\u003ewithResource('generateIntegers')\n    -\u003ewithParameters(['n' =\u003e 10, 'min' =\u003e 0, 'max' =\u003e 100]);\n\n$result = (new RandomOrgAPI())\n    -\u003ewithApiKey('00000000-0000-0000-0000-000000000000')\n    -\u003egetData($generateIntegers);\n\nprint_r($result);\n\n$provider = (new Provider())-\u003ewithResource('generateStrings')\n    -\u003ewithParameters([\n        'n' =\u003e 10,\n        'length' =\u003e 15,\n        'characters' =\u003e implode(array_merge(range('A', 'Z'), range('a', 'z'), range(0, 9))),\n    ]);\n\n$result = (new RandomOrgAPI(null, ['apiKey' =\u003e '00000000-0000-0000-0000-000000000000']))-\u003egetData($provider);\n\nprint_r($result);\n```\n\nProviding the API key can be accomplished using an environment variable `RANDOM_ORG_APIKEY` or by using the method proper\nparameters in the `RandomOrgAPI` constructor, or by using `(new RandomOrgAPI())-\u003ewithApiKey(string $apiKey)`.\n\n## Third party libraries integration\n\n### ircmaxell/RandomLib integration\n\nYAROC provides a Source for [ircmaxell/RandomLib](https://github.com/ircmaxell/RandomLib).\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse drupol\\Yaroc\\RandomOrgAPI;\nuse drupol\\Yaroc\\Plugin\\RandomLib\\Source\\RandomOrg;\n\n$randomOrgApi = new RandomOrgAPI();\n\n$randomLib = new RandomLib\\Factory();\n$generator = $randomLib-\u003egetGenerator(new SecurityLib\\Strength(SecurityLib\\Strength::HIGH))\n  -\u003eaddSource(new RandomOrg($randomOrgApi));\n$randomString = $generator-\u003egenerateString(10);\n\necho $randomString;\n\n```\n### rchouinard/rych-random integration\n\nYAROC provides a Generator for [rchouinard/rych-random](https://github.com/rchouinard/rych-random).\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse drupol\\Yaroc\\RandomOrgAPI;\nuse drupol\\Yaroc\\Plugin\\RychRandom\\Generator\\RandomOrg;\n\n$randomOrgApi = new RandomOrgAPI();\n\n$rychRandom = new Rych\\Random\\Random(new RandomOrg($randomOrgApi));\n$randomString = $rychRandom-\u003egetRandomString(8);\n\necho $randomString;\n\n```\n\n## History\n\nI discovered the [Random.Org](https://random.org) the 22 November 2016, by chance and I found the idea amazing.\n\nI had the idea to build a library that would be following the best development practice and up to date.\n\nFeel free to contact me at: pol.dellaiera@protonmail.com\n\n## Code quality, tests and benchmarks\n\nTo run the tests, run this command:\n\n```\nRANDOM_ORG_APIKEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx composer grumphp\n```\n\nEvery time changes are introduced into the library, [Travis CI](https://travis-ci.org/drupol/yaroc/builds) run the tests and the benchmarks.\n\nThe library has tests written with [PHPSpec](http://www.phpspec.net/).\nFeel free to check them out in the `spec` directory. Run `composer phpspec` to trigger the tests.\n\nBefore each commit some inspections are executed with [GrumPHP](https://github.com/phpro/grumphp), run `./vendor/bin/grumphp run` to check manually.\n\n[PHPInfection](https://github.com/infection/infection) is used to ensure that your code is properly tested, run `composer infection` to test your code.\n\n## Contributing\n\nFeel free to contribute by sending Github pull requests. I'm quite reactive :-)\n\nIf you can't contribute to the code, you can also sponsor me on [Github][github sponsor] or [Paypal][paypal sponsor].\n\n## Changelog\n\nSee [CHANGELOG.md][changelog-md] for a changelog based on [git commits][git-commits].\n\n[packagist]: https://packagist.org/packages/drupol/yaroc\n[latest stable version]: https://img.shields.io/packagist/v/drupol/yaroc.svg?style=flat-square\n[github stars]: https://img.shields.io/github/stars/drupol/yaroc.svg?style=flat-square\n[total downloads]: https://img.shields.io/packagist/dt/drupol/yaroc.svg?style=flat-square\n[github workflow status]: https://img.shields.io/github/workflow/status/drupol/yaroc/Unit%20tests?style=flat-square\n[code quality]: https://img.shields.io/scrutinizer/quality/g/drupol/yaroc/master.svg?style=flat-square\n[scrutinizer code quality]: https://scrutinizer-ci.com/g/drupol/yaroc/?branch=master\n[type coverage]: https://img.shields.io/badge/dynamic/json?style=flat-square\u0026color=color\u0026label=Type%20coverage\u0026query=message\u0026url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Fdrupol%2Fyaroc%2Fcoverage\n[sheperd type coverage]: https://shepherd.dev/github/drupol/yaroc\n[code coverage]: https://img.shields.io/scrutinizer/coverage/g/drupol/yaroc/master.svg?style=flat-square\n[license]: https://img.shields.io/packagist/l/drupol/yaroc.svg?style=flat-square\n[donate github]: https://img.shields.io/badge/Sponsor-Github-brightgreen.svg?style=flat-square\n[donate paypal]: https://img.shields.io/badge/Sponsor-Paypal-brightgreen.svg?style=flat-square\n[github actions]: https://github.com/drupol/yaroc/actions\n[github sponsor]: https://github.com/sponsors/drupol\n[paypal sponsor]: https://www.paypal.me/drupol\n[changelog-md]: https://github.com/drupol/yaroc/blob/master/CHANGELOG.md\n[git-commits]: https://github.com/drupol/yaroc/commits/master\n[changelog-releases]: https://github.com/drupol/yaroc/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fyaroc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrupol%2Fyaroc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fyaroc/lists"}