{"id":13507853,"url":"https://github.com/mana-ethereum/ex_rlp","last_synced_at":"2025-08-17T15:03:28.231Z","repository":{"id":33494097,"uuid":"93916503","full_name":"mana-ethereum/ex_rlp","owner":"mana-ethereum","description":"Elixir implementation of Ethereum's RLP (Recursive Length Prefix) encoding","archived":false,"fork":false,"pushed_at":"2025-08-11T04:16:29.000Z","size":168,"stargazers_count":32,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-17T03:29:21.651Z","etag":null,"topics":["elixir","encoding","ethereum"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/mana-ethereum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-06-10T04:49:59.000Z","updated_at":"2025-07-14T06:59:59.000Z","dependencies_parsed_at":"2024-01-31T07:03:42.628Z","dependency_job_id":"97bff8ad-1348-4cbc-8d23-dba8f9cbe4ec","html_url":"https://github.com/mana-ethereum/ex_rlp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mana-ethereum/ex_rlp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mana-ethereum%2Fex_rlp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mana-ethereum%2Fex_rlp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mana-ethereum%2Fex_rlp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mana-ethereum%2Fex_rlp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mana-ethereum","download_url":"https://codeload.github.com/mana-ethereum/ex_rlp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mana-ethereum%2Fex_rlp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270863048,"owners_count":24658714,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["elixir","encoding","ethereum"],"created_at":"2024-08-01T02:00:41.024Z","updated_at":"2025-08-17T15:03:28.191Z","avatar_url":"https://github.com/mana-ethereum.png","language":"Elixir","funding_links":[],"categories":["Encoding and Compression"],"sub_categories":[],"readme":"# ExRLP\n\n[![CircleCI](https://circleci.com/gh/mana-ethereum/ex_rlp.svg?style=svg)](https://circleci.com/gh/mana-ethereum/ex_rlp)\n[![Module Version](https://img.shields.io/hexpm/v/ex_rlp.svg)](https://hex.pm/packages/ex_rlp)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ex_rlp/)\n[![Total Download](https://img.shields.io/hexpm/dt/ex_rlp.svg)](https://hex.pm/packages/ex_rlp)\n[![License](https://img.shields.io/hexpm/l/ex_rlp.svg)](https://github.com/mana-ethereum/ex_rlp/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/mana-ethereum/ex_rlp.svg)](https://github.com/mana-ethereum/ex_rlp/commits/master)\n\nElixir implementation of Ethereum's RLP (Recursive Length Prefix) encoding.\n\nThe encoding's specification can be found in [the yellow paper](http://yellowpaper.io/) or in the [ethereum wiki](https://github.com/ethereum/wiki/wiki/RLP).\n\n## Installation\n\nThe easiest way to add ExRLP to your project is by [using Mix](http://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html).\n\nAdd `:ex_rlp` as a dependency to your project's `mix.exs`:\n\n```elixir\ndefp deps do\n  [\n    {:ex_rlp, \"~\u003e 0.6.0\"}\n  ]\nend\n```\n\nAnd run:\n\n```bash\n$ mix deps.get\n```\n\n## Basic Usage\n\nUse `ExRLP.encode/1` method to encode an item to RLP representation. An item can be non-negative integer, binary or list. List can contain integers, binaries or lists.\n\n```elixir\niex\u003e \"dog\" |\u003e ExRLP.encode(encoding: :hex)\n\"83646f67\"\n\niex\u003e \"dog\" |\u003e ExRLP.encode(encoding: :binary)\n\u003c\u003c0x83, 0x64, 0x6f, 0x67\u003e\u003e\n\niex\u003e 1000 |\u003e ExRLP.encode(encoding: :hex)\n\"8203e8\"\n\n# Default encoding is binary\niex\u003e 1000 |\u003e ExRLP.encode\n\u003c\u003c0x82, 0x03, 0xe8\u003e\u003e\n\niex\u003e [ [ [], [] ], [] ] |\u003e ExRLP.encode(encoding: :hex)\n\"c4c2c0c0c0\"\n```\n\nUse `ExRLP.decode/1` method to decode a RLP encoded data. All items except lists are decoded as binaries so additional deserialization is needed if initially an item of another type was encoded.\n\n\n```elixir\niex\u003e \"83646f67\" |\u003e ExRLP.decode(encoding: :hex)\n\"dog\"\n\niex\u003e \"8203e8\" |\u003e ExRLP.decode(encoding: :hex) |\u003e :binary.decode_unsigned\n1000\n\niex\u003e \"c4c2c0c0c0\" |\u003e ExRLP.decode(encoding: :hex)\n[[[], []], []]\n```\n\nMore examples can be found in test files.\n\n## Protocols\n\nYou can define protocols for encoding/decoding custom data types.\n\n```elixir\ndefmodule ExRLP.LogEntry do\n  defstruct address: nil, topics: [], data: nil\n\n  @type t :: %__MODULE__{\n          address: EVM.address(),\n          topics: [integer()],\n          data: binary()\n        }\n\n  @spec new(binary, [integer()], binary()) :: t()\n  def new(address, topics, data) do\n    %__MODULE__{\n      address: address,\n      topics: topics,\n      data: data\n    }\n  end\n\n  def to_list(log) do\n    [log.address, log.topics, log.data]\n  end\nend\n\ndefimpl ExRLP.Encode, for: ExRLP.LogEntry do\n  alias ExRLP.{Encode, LogEntry}\n\n  @spec encode(LogEntry.t(), keyword()) :: binary()\n  def encode(log, options \\\\ []) do\n    log\n    |\u003e LogEntry.to_list()\n    |\u003e Encode.encode(options)\n  end\nend\n```\n\n## Contributing\n\n1. [Fork it!](https://github.com/exthereum/ex_rlp/fork)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Author\n\nAyrat Badykov [(@ayrat555)](https://github.com/ayrat555)\n\n## Copyright and License\n\nCopyright (c) 2017-present Geoffrey Hayes, Ayrat Badykov, Mason Forest\n\nExRLP is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file\nfor further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmana-ethereum%2Fex_rlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmana-ethereum%2Fex_rlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmana-ethereum%2Fex_rlp/lists"}