{"id":27198479,"url":"https://github.com/valtzu/php-fakerandom","last_synced_at":"2026-02-13T17:04:20.601Z","repository":{"id":53874287,"uuid":"521763539","full_name":"valtzu/php-fakerandom","owner":"valtzu","description":"Mock random_bytes \u0026 random_int","archived":false,"fork":false,"pushed_at":"2025-12-16T07:19:55.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-19T20:58:04.259Z","etag":null,"topics":["mocking","php","php-extension","php8","random","testing"],"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/valtzu.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-08-05T20:07:28.000Z","updated_at":"2025-12-16T07:19:09.000Z","dependencies_parsed_at":"2023-12-02T19:28:07.489Z","dependency_job_id":"813b4e5a-0b8a-468e-a591-a5e4ba7895ae","html_url":"https://github.com/valtzu/php-fakerandom","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/valtzu/php-fakerandom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtzu%2Fphp-fakerandom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtzu%2Fphp-fakerandom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtzu%2Fphp-fakerandom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtzu%2Fphp-fakerandom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valtzu","download_url":"https://codeload.github.com/valtzu/php-fakerandom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valtzu%2Fphp-fakerandom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29412670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["mocking","php","php-extension","php8","random","testing"],"created_at":"2025-04-09T20:39:59.001Z","updated_at":"2026-02-13T17:04:20.597Z","avatar_url":"https://github.com/valtzu.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"fakerandom extension for PHP\n============================\n\nPHP extension that mocks `random_int` \u0026 `random_bytes` for testing purposes.\n\n## Installation\n\n### Docker\n```dockerfile\nFROM php:8.5\nRUN curl -L https://github.com/valtzu/php-fakerandom/releases/download/v0.1.6/fakerandom_20250925.so \u003e /usr/local/lib/php/extensions/no-debug-non-zts-20250925/fakerandom.so ;\\\n    docker-php-ext-enable fakerandom\n```\n\n## Usage\n\n### `random_int`\n```php\nfake_random_enable();\necho random_int(1, 3); // will be always 1 + (3 - 1) / 2 = 2\n\nfake_random_disable();\necho random_int(1, 3); // original functionality restored\n```\n\n\n### `random_bytes`\n```php\nfake_random_enable();\necho bin2hex(random_bytes(3)); // will be always 010203 (goes up until \"ff\" and then \"00\" again)\n\nfake_random_disable();\necho bin2hex(random_bytes(3)); // original functionality restored\n```\n\n## Build \u0026 test\n\n```\ndocker-compose up --build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaltzu%2Fphp-fakerandom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaltzu%2Fphp-fakerandom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaltzu%2Fphp-fakerandom/lists"}