{"id":19325942,"url":"https://github.com/alephao/swift-rlp","last_synced_at":"2025-12-11T22:59:24.768Z","repository":{"id":56921612,"uuid":"119675387","full_name":"alephao/swift-rlp","owner":"alephao","description":"Recursive Length Prefix encoding written in Swift","archived":false,"fork":false,"pushed_at":"2024-01-29T16:23:40.000Z","size":81,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-16T07:10:59.656Z","etag":null,"topics":["encoding","ethereum","ios","macos","rlp","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/alephao.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}},"created_at":"2018-01-31T10:57:46.000Z","updated_at":"2024-07-10T22:08:10.000Z","dependencies_parsed_at":"2024-01-29T19:43:51.489Z","dependency_job_id":null,"html_url":"https://github.com/alephao/swift-rlp","commit_stats":null,"previous_names":["alephao/rlpswift","bitfwdcommunity/rlpswift","alephao/swift-rlp"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fswift-rlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fswift-rlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fswift-rlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alephao%2Fswift-rlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alephao","download_url":"https://codeload.github.com/alephao/swift-rlp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250318824,"owners_count":21410996,"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":["encoding","ethereum","ios","macos","rlp","swift"],"created_at":"2024-11-10T02:11:58.947Z","updated_at":"2025-12-11T22:59:24.738Z","avatar_url":"https://github.com/alephao.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RLP\n[![Swift 6.1](https://img.shields.io/badge/Swift-6.1-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Version](https://img.shields.io/badge/SPM-1.0.0-orange.svg?stlyle=flat)](https://github.com/alephao/swift-rlp/releases/tag/v1.0.0)\n\nThis is a simple, pure Swift implementation of Recursive Length Prefix Encoding, a serialisation method for encoding arbitrarily structured binary data (byte arrays).\n\nRLP Encoding is used in Ethereum. You can read more about it here:\n* [Ethereum Wiki - RLP](https://github.com/ethereum/wiki/wiki/RLP)\n* [Ethereum Yellowpaper](https://ethereum.github.io/yellowpaper/paper.pdf) (Appendix B)\n\n## Library Usage\n\nRLP is available through [Swift Package Manager](https://swift.org/package-manager/).\n\nAdding RLP as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n  .package(url: \"https://github.com/alephao/swift-rlp.git\", from: \"1.0.0\")\n],\ntargets: [\n    .target(\n      name: \"MyTarget\",\n      dependencies: [\n        .product(name: \"RLP\", package: \"swift-rlp\")\n      ]\n    ),\n]\n```\n\n### Encoding\n\n```swift\nimport RLP\n\nlet encoder = RLPEncoder()\n\n// String Encoding\ntry encoder.encode(.string(\"dog\"))\ntry encoder.encode(string: \"dog\")\n\n// Array Encoding\ntry encoder.encode(.array([\"d\", \"o\", \"g\"]))\n```\n\n### Decoding\n\n```swift\nimport RLP\n\nlet encodedData = try RLPEncoder().encode(string: \"dog\")\n\nlet decoder = RLPDecoder()\ntry decoder.decode(from: encodedData) // RLPValue.string(\"dog\")\n```\n\n## CLI\n\nCurrently, the CLI is only available via source code. To use it, clone this repo and run:\n\n### Encoding\n\n```bash\n$ swift run cli encode dog\n\u003e 0x83646F67\n```\n\n### Decoding\n\n```bash\n$ swift run cli decode 0x83646F67\n\u003e string(\"dog\")\n```\n\n## License\n\nRLP is released under an [MIT](https://tldrlegal.com/license/mit-license) license. See [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falephao%2Fswift-rlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falephao%2Fswift-rlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falephao%2Fswift-rlp/lists"}