{"id":15564085,"url":"https://github.com/dahlia/bencodex-php","last_synced_at":"2025-10-20T11:20:37.217Z","repository":{"id":62493020,"uuid":"417887496","full_name":"dahlia/bencodex-php","owner":"dahlia","description":"Bencodex reader/writer for PHP","archived":false,"fork":false,"pushed_at":"2022-09-15T16:40:20.000Z","size":334,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T00:53:35.916Z","etag":null,"topics":["bencodex","bencoding","php","serialization"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/bencodex/bencodex","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/dahlia.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}},"created_at":"2021-10-16T16:41:30.000Z","updated_at":"2021-10-20T02:03:38.000Z","dependencies_parsed_at":"2022-11-02T11:31:06.270Z","dependency_job_id":null,"html_url":"https://github.com/dahlia/bencodex-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fbencodex-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fbencodex-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fbencodex-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dahlia%2Fbencodex-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dahlia","download_url":"https://codeload.github.com/dahlia/bencodex-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978739,"owners_count":21834915,"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":["bencodex","bencoding","php","serialization"],"created_at":"2024-10-02T16:36:11.458Z","updated_at":"2025-10-20T11:20:37.143Z","avatar_url":"https://github.com/dahlia.png","language":"PHP","readme":"Bencodex reader/writer for PHP\n==============================\n\n[![Packagist Version][]][Packagist]\n[![MIT License][]](LICENSE)\n[![GitHub Actions Status][]][GitHub Actions]\n\n[Packagist]: https://packagist.org/packages/bencodex/bencodex\n[Packagist Version]: http://poser.pugx.org/bencodex/bencodex/v\n[MIT License]: http://poser.pugx.org/bencodex/bencodex/license\n[GitHub Actions Status]: https://github.com/dahlia/bencodex-php/actions/workflows/build.yaml/badge.svg\n[GitHub Actions]: https://github.com/dahlia/bencodex-php/actions/workflows/build.yaml\n\nThis package implements [Bencodex] serialization format which extends\n[Bencoding].  Complianet with Bencodex 1.2.\n\n~~~ php\nphp \u003e echo Bencodex\\encode(['foo' =\u003e 123, 'bar' =\u003e [true, false]]);\ndu3:barltfeu3:fooi123ee\nphp \u003e var_dump(Bencodex\\decode('du3:barltfeu3:fooi123ee'));\nobject(stdClass)#4 (2) {\n  [\"bar\"]=\u003e\n  array(2) {\n    [0]=\u003e\n    bool(true)\n    [1]=\u003e\n    bool(false)\n  }\n  [\"foo\"]=\u003e\n  int(123)\n}\n~~~\n\n\nRequirements\n------------\n\n[![PHP Version Requirement][]][Packagist]\n\n- PHP 5.4 or later\n- [iconv] extension (`--with-iconv`)\n\n[PHP Version Requirement]: http://poser.pugx.org/bencodex/bencodex/require/php\n[iconv]: https://www.php.net/manual/en/book.iconv.php\n\n\nType correspondences\n--------------------\n\n| PHP                                    | Bencodex                  |\n|----------------------------------------|---------------------------|\n| Null                                   | Null                      |\n| Boolean                                | Boolean                   |\n| Integer                                | Integer                   |\n| Double[^1]                             | Integer (truncated)       |\n| Numeric string[^2]                     | Integer ≥ [`PHP_INT_MAX`] |\n| String which can be decoded as Unicode | Text[^2]                  |\n| String otherwise                       | Binary[^2]                |\n| List-like array[^3]                    | List                      |\n| Map-like array[^1]                     | Dictionary                |\n| Object                                 | Dictionary                |\n\n[^1]: One-way types only available for encoding.\n[^2]: One-way types only available for decoding.\n[^3]: Determined by [`array_is_list()` function][array_is_list].\n\n[array_is_list]: https://www.php.net/manual/en/function.array-is-list\n[`PHP_INT_MAX`]: https://www.php.net/manual/en/reserved.constants.php#constant.php-int-max\n\nUsage\n-----\n\n- [`\\Bencodex\\encode(mixed $value): string`][encode]: Encodes a PHP `$value`\n  into Bencodex data.\n- [`\\Bencodex\\decode(string $bencodex): mixed`][decode]: Decodes Bencodex data\n  into a PHP value.\n\nThe above APIs are merely façade, and optional parameters are omitted.\nSee the [complete API docs][1] as well.\n\n[encode]: https://dahlia.github.io/bencodex-php/namespaces/bencodex.html#function_encode\n[decode]: https://dahlia.github.io/bencodex-php/namespaces/bencodex.html#function_decode\n[1]: https://dahlia.github.io/bencodex-php/\n\n\n[Bencodex]: https://bencodex.org/\n[Bencoding]: https://www.bittorrent.org/beps/bep_0003.html#bencoding\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahlia%2Fbencodex-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdahlia%2Fbencodex-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdahlia%2Fbencodex-php/lists"}