{"id":13509308,"url":"https://github.com/AntonFagerberg/elixir_bencode","last_synced_at":"2025-03-30T13:31:57.466Z","repository":{"id":24203178,"uuid":"27594623","full_name":"AntonFagerberg/elixir_bencode","owner":"AntonFagerberg","description":"Bencode implemented in Elixir","archived":false,"fork":false,"pushed_at":"2015-05-20T11:04:39.000Z","size":260,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T00:41:08.217Z","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/AntonFagerberg.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-05T14:21:12.000Z","updated_at":"2018-05-11T14:51:55.000Z","dependencies_parsed_at":"2022-08-22T14:30:32.724Z","dependency_job_id":null,"html_url":"https://github.com/AntonFagerberg/elixir_bencode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonFagerberg%2Felixir_bencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonFagerberg%2Felixir_bencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonFagerberg%2Felixir_bencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntonFagerberg%2Felixir_bencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntonFagerberg","download_url":"https://codeload.github.com/AntonFagerberg/elixir_bencode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246323952,"owners_count":20759056,"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:01:06.002Z","updated_at":"2025-03-30T13:31:57.171Z","avatar_url":"https://github.com/AntonFagerberg.png","language":"Elixir","funding_links":[],"categories":["Text and Numbers"],"sub_categories":[],"readme":"Elixir Bencode\n==============\n\nBencode decoder / encoder using Elixir data structures.\n\n[Documentation for Elixir Bencode is available online](http://hexdocs.pm/elixir_bencode/)\n\n## Installation\nAdd it to to your `mix.exs` dependencies:\n\n```elixir\ndefp deps do\n  [{:elixir_bencode, \"~\u003e 1.0.0\"}]\nend\n```\n\n## Examples\n```elixir\n## Encode strings (with thrown exceptions)\nBencode.encode!(\"hello world\")\n\"11:hello world\"\n\n## Encode integers\nBencode.encode!(42)\n\"i42e\"\n\n## Encode lists\nBencode.encode!([1,2,3])\n\"li1ei2ei3ee\"\n\n## Encode maps\nBencode.encode!(%{\"a\" =\u003e 1, 2 =\u003e \"b\"})\n#\"di2e1:b1:ai1ee\"\n\n## Encode Dicts\nBencode.encode!(HashDict.new |\u003e Dict.put :hello, :world)\n\"d5:hello5:worlde\"\n\n## Encode bitstrings\nBencode.encode!(\u003c\u003c1,2,3,4\u003e\u003e)\n\u003c\u003c52, 58, 1, 2, 3, 4\u003e\u003e\n\n## Encode without exceptions\nBencode.encode(2.0)\n{:error, :invalid_format}\n\n## Decode strings (with thrown expcetions)\nBencode.decode!(\"5:hello\")\n\"hello\"\n\n## Decode integers\nBencode.decode!(\"i42e\")\n42\n\n## Decode lists \nBencode.decode!(\"li1ei2ei3ee\")\n[1, 2, 3]\n\n## Decode maps\nBencode.decode!(\"d5:hello5:worlde\")\n%{\"hello\" =\u003e \"world\"}\n\n## Decode without exceptions\nBencode.decode(\"4:spam\")\n{:ok, \"spam\"}\n```\n\n## Copyright\n\nCopyright (c) 2014 Anton Fagerberg. See [LICENSE](LICENSE) for further details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAntonFagerberg%2Felixir_bencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAntonFagerberg%2Felixir_bencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAntonFagerberg%2Felixir_bencode/lists"}