{"id":20152894,"url":"https://github.com/web3p/rlp","last_synced_at":"2025-08-20T16:32:22.340Z","repository":{"id":28883208,"uuid":"119619870","full_name":"web3p/rlp","owner":"web3p","description":"Recursive Length Prefix Encoding in PHP.","archived":false,"fork":false,"pushed_at":"2023-02-08T20:14:15.000Z","size":93,"stargazers_count":28,"open_issues_count":2,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-19T03:19:57.636Z","etag":null,"topics":["ethreum","hacktoberfest","rlp","transaction"],"latest_commit_sha":null,"homepage":"https://www.web3p.xyz/rlp.html","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/web3p.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-31T01:53:54.000Z","updated_at":"2024-09-11T08:20:02.000Z","dependencies_parsed_at":"2024-06-18T13:45:10.619Z","dependency_job_id":null,"html_url":"https://github.com/web3p/rlp","commit_stats":{"total_commits":60,"total_committers":4,"mean_commits":15.0,"dds":0.06666666666666665,"last_synced_commit":"d35f84b32b9cfdf2ee326e7f4ed7f8a0cf6d2faa"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Frlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Frlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Frlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Frlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3p","download_url":"https://codeload.github.com/web3p/rlp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230438185,"owners_count":18225870,"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":["ethreum","hacktoberfest","rlp","transaction"],"created_at":"2024-11-13T23:15:16.378Z","updated_at":"2024-12-19T13:08:07.239Z","avatar_url":"https://github.com/web3p.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rlp\n\n[![PHP](https://github.com/web3p/rlp/actions/workflows/php.yml/badge.svg)](https://github.com/web3p/rlp/actions/workflows/php.yml)\n[![codecov](https://codecov.io/gh/web3p/rlp/branch/master/graph/badge.svg)](https://codecov.io/gh/web3p/rlp)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/web3p/rlp/blob/master/LICENSE)\n\nRecursive Length Prefix Encoding in PHP.\n\n# Install\n\nSet minimum stability to dev\n```\ncomposer require web3p/rlp\n```\n\n# Usage\n\nRLP encode:\n\n```php\nuse Web3p\\RLP\\RLP;\n\n$rlp = new RLP;\n// c483646f67\n$encoded = $rlp-\u003eencode(['dog']);\n\n// 83646f67\n$encoded = $rlp-\u003eencode('dog');\n```\n\nRLP decode:\n\n```php\nuse Web3p\\RLP\\RLP;\nuse Web3p\\RLP\\Types\\Str;\n\n$rlp = new RLP;\n$encoded = $rlp-\u003eencode(['dog']);\n\n// only accept 0x prefixed hex string\n$decoded = $rlp-\u003edecode('0x' . $encoded);\n\n// show 646f67\necho $decoded[0];\n\n// show dog\necho hex2bin($decoded[0]);\n\n// or you can\necho Str::decodeHex($decoded[0]);\n```\n\n# API\n\n### Web3p\\RLP\\RLP\n\n#### encode\n\nReturns recursive length prefix encoding of given inputs.\n\n`encode(mixed $inputs)`\n\nMixed inputs - array of string, integer or numeric string.\n\n\u003e Note: output is not zero prefixed.\n\n###### Example\n\n* Encode array of string.\n\n```php\nuse Web3p\\RLP\\RLP;\n\n$rlp = new RLP;\n$encoded = $rlp-\u003eencode(['web3p', 'ethereum', 'solidity']);\n```\n\n#### decode\n\nReturns array recursive length prefix decoding of given data.\n\n`decode(string $input)`\n\nString input - recursive length prefix encoded string.\n\n\u003e Note: output is not zero prefixed.\n\n###### Example\n\n* Decode recursive length prefix encoded string.\n\n```php\nuse Web3p\\RLP\\RLP;\nuse Web3p\\RLP\\Types\\Str;\n\n$rlp = new RLP;\n$encoded = $rlp-\u003eencode(['web3p', 'ethereum', 'solidity']);\n$decoded = $rlp-\u003edecode('0x' . $encoded);\n\n// echo web3p\necho hex2bin($decoded[0]);\n\n// echo ethereum\necho hex2bin($decoded[1]);\n\n// echo solidity\necho hex2bin($decoded[2]);\n\n// or you can\necho Str::decodeHex($decoded[0]);\necho Str::decodeHex($decoded[1]);\necho Str::decodeHex($decoded[2]);\n```\n\n# License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3p%2Frlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3p%2Frlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3p%2Frlp/lists"}