{"id":13507473,"url":"https://github.com/alehander92/wire","last_synced_at":"2025-12-12T00:11:27.486Z","repository":{"id":25193468,"uuid":"28617041","full_name":"alehander92/wire","owner":"alehander92","description":"encode and decode bittorrent peer wire protocol messages with elixir","archived":false,"fork":false,"pushed_at":"2016-01-03T12:01:21.000Z","size":14,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-10T19:06:04.204Z","etag":null,"topics":[],"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/alehander92.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":"2014-12-30T04:05:11.000Z","updated_at":"2024-10-25T20:27:17.000Z","dependencies_parsed_at":"2022-07-12T07:17:05.635Z","dependency_job_id":null,"html_url":"https://github.com/alehander92/wire","commit_stats":null,"previous_names":["alehander42/wire"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehander92%2Fwire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehander92%2Fwire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehander92%2Fwire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alehander92%2Fwire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alehander92","download_url":"https://codeload.github.com/alehander92/wire/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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":[],"created_at":"2024-08-01T02:00:34.523Z","updated_at":"2025-10-21T15:36:49.133Z","avatar_url":"https://github.com/alehander92.png","language":"Elixir","funding_links":[],"categories":["Bittorrent"],"sub_categories":[],"readme":"Wire\n====\n\n[![Build Status](https://travis-ci.org/alehander42/wire.svg)](https://travis-ci.org/alehander42/wire/)\n\nWire is an elixir package for decoding and encoding\nbittorrent peer wire protocol messages.\n\n\nA message is represented in the library as a keyword list with\n`:type`: the type of the message (`:keep_alive`, :`not_interested`, etc)\nand the other fields of the message, e.g.\n\n```elixir\nh = [type: :have, piece_index: 4]\n```\n\n```elixir\n\nWire.encode [type: :interested] # \u003c\u003c0, 0, 0, 1, 2\u003e\u003e\nWire.encode [type: :bitfield, field: \u003c\u003c0, 4\u003e\u003e] # \u003c\u003c0, 0, 0, 3, 5, 0, 4\u003e\u003e\n```\n\n`decode_messages` decodes a binary containing 0 or more messages and\nreturns a list of messages and the remaining bytes\n\n```elixir\n\n\nWire.decode_messages(\u003c\u003c0, 0, 0, 6, 5, 0, 2, 4, 3, 1\u003e\u003e)\n# {[[type: :bitfield, field: \u003c\u003c0, 2, 4, 3, 1\u003e\u003e]], \u003c\u003c\u003e\u003e}\nWire.decode_messages(\u003c\u003c 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0xf, 5 \u003e\u003e)\n# {[[type: :keep_alive], [type: :interested]], \u003c\u003c0, 0, 0, 0xf, 5\u003e\u003e})\n\n\n```\n\n## Install\n\nAdd to your mix.exs deps\n\n```elixir\n{:wire, \"~\u003e 0.2.0\"}\n```\n\n## Development\n\nBuilt and maintained by Alexander Ivanov, with substantial contributions by [Florian Adamsky](https://github.com/cit)\n\n## LICENSE\n\nMIT\n\n## Copyright\n\nCopyright (c) 2014-2015 Alexander Ivanov. See [LICENSE](LICENSE) for further details\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falehander92%2Fwire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falehander92%2Fwire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falehander92%2Fwire/lists"}