{"action":"created","comment":{"url":"https://api.github.com/repos/aeternity/elixir-node/pulls/comments/175433537","pull_request_review_id":104959927,"id":175433537,"diff_hunk":"@@ -1,14 +1,20 @@\n # Taken from http://minhajuddin.com/2016/11/01/how-to-extract-bits-from-a-binary-in-elixir/\n # License: CC BY-SA 3.0\n defmodule Aeutil.Bits do\n-  def bech32_encode(prefix, bin) do\n-    SegwitAddr.encode(prefix, 0, :binary.bin_to_list(bin))\n+  @prefix_list [\"ak$\", \"bh$\", \"bs$\", \"tx$\", \"bx$\", \"ok$\", \"cs$\", \"tr$\"]\n+\n+  def encode58(prefix, data) when is_binary(data) do\n+    prefix <> Kernel.to_string(:base58.binary_to_base58(data))\n   end\n \n-  def bech32_decode(bech32) do\n-    case SegwitAddr.decode(bech32) do\n-      {:ok, {_, _, bin_list}} -> :binary.list_to_bin(bin_list)\n-      {:error, _} = error -> error\n+  def decode58(data) when is_binary(data) do","path":"apps/aeutil/lib/bits.ex","position":16,"original_position":16,"commit_id":"1c9ffd0899f3c8145da36b0179283b89f0dfdcf5","original_commit_id":"1c9ffd0899f3c8145da36b0179283b89f0dfdcf5","user":{"login":"thepiwo","id":6539235,"avatar_url":"https://avatars1.githubusercontent.com/u/6539235?v=4","gravatar_id":"","url":"https://api.github.com/users/thepiwo","html_url":"https://github.com/thepiwo","followers_url":"https://api.github.com/users/thepiwo/followers","following_url":"https://api.github.com/users/thepiwo/following{/other_user}","gists_url":"https://api.github.com/users/thepiwo/gists{/gist_id}","starred_url":"https://api.github.com/users/thepiwo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thepiwo/subscriptions","organizations_url":"https://api.github.com/users/thepiwo/orgs","repos_url":"https://api.github.com/users/thepiwo/repos","events_url":"https://api.github.com/users/thepiwo/events{/privacy}","received_events_url":"https://api.github.com/users/thepiwo/received_events","type":"User","site_admin":false},"body":"can you pass the expected prefix as atom here as well, fail if the one in data doesn't match the expected prefix","created_at":"2018-03-19T13:31:29Z","updated_at":"2018-03-19T13:31:30Z","html_url":"https://github.com/aeternity/elixir-node/pull/290#discussion_r175433537","pull_request_url":"https://api.github.com/repos/aeternity/elixir-node/pulls/290","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/aeternity/elixir-node/pulls/comments/175433537"},"html":{"href":"https://github.com/aeternity/elixir-node/pull/290#discussion_r175433537"},"pull_request":{"href":"https://api.github.com/repos/aeternity/elixir-node/pulls/290"}}},"pull_request":{"url":"https://api.github.com/repos/aeternity/elixir-node/pulls/290","id":175574823,"html_url":"https://github.com/aeternity/elixir-node/pull/290","diff_url":"https://github.com/aeternity/elixir-node/pull/290.diff","patch_url":"https://github.com/aeternity/elixir-node/pull/290.patch","issue_url":"https://api.github.com/repos/aeternity/elixir-node/issues/290","number":290,"state":"open","locked":false,"title":"[GH-#256] Adjusted block, header encodings","user":{"login":"Artur64","id":30468851,"avatar_url":"https://avatars1.githubusercontent.com/u/30468851?v=4","gravatar_id":"","url":"https://api.github.com/users/Artur64","html_url":"https://github.com/Artur64","followers_url":"https://api.github.com/users/Artur64/followers","following_url":"https://api.github.com/users/Artur64/following{/other_user}","gists_url":"https://api.github.com/users/Artur64/gists{/gist_id}","starred_url":"https://api.github.com/users/Artur64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Artur64/subscriptions","organizations_url":"https://api.github.com/users/Artur64/orgs","repos_url":"https://api.github.com/users/Artur64/repos","events_url":"https://api.github.com/users/Artur64/events{/privacy}","received_events_url":"https://api.github.com/users/Artur64/received_events","type":"User","site_admin":false},"body":"Resolves #255, resolves #256","created_at":"2018-03-16T15:56:47Z","updated_at":"2018-03-19T13:31:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"134c86e5b59c33e7a331d887e51933e8e7890aac","assignee":{"login":"Artur64","id":30468851,"avatar_url":"https://avatars1.githubusercontent.com/u/30468851?v=4","gravatar_id":"","url":"https://api.github.com/users/Artur64","html_url":"https://github.com/Artur64","followers_url":"https://api.github.com/users/Artur64/followers","following_url":"https://api.github.com/users/Artur64/following{/other_user}","gists_url":"https://api.github.com/users/Artur64/gists{/gist_id}","starred_url":"https://api.github.com/users/Artur64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Artur64/subscriptions","organizations_url":"https://api.github.com/users/Artur64/orgs","repos_url":"https://api.github.com/users/Artur64/repos","events_url":"https://api.github.com/users/Artur64/events{/privacy}","received_events_url":"https://api.github.com/users/Artur64/received_events","type":"User","site_admin":false},"assignees":[{"login":"Artur64","id":30468851,"avatar_url":"https://avatars1.githubusercontent.com/u/30468851?v=4","gravatar_id":"","url":"https://api.github.com/users/Artur64","html_url":"https://github.com/Artur64","followers_url":"https://api.github.com/users/Artur64/followers","following_url":"https://api.github.com/users/Artur64/following{/other_user}","gists_url":"https://api.github.com/users/Artur64/gists{/gist_id}","starred_url":"https://api.github.com/users/Artur64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Artur64/subscriptions","organizations_url":"https://api.github.com/users/Artur64/orgs","repos_url":"https://api.github.com/users/Artur64/repos","events_url":"https://api.github.com/users/Artur64/events{/privacy}","received_events_url":"https://api.github.com/users/Artur64/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"gspasov","id":25534303,"avatar_url":"https://avatars3.githubusercontent.com/u/25534303?v=4","gravatar_id":"","url":"https://api.github.com/users/gspasov","html_url":"https://github.com/gspasov","followers_url":"https://api.github.com/users/gspasov/followers","following_url":"https://api.github.com/users/gspasov/following{/other_user}","gists_url":"https://api.github.com/users/gspasov/gists{/gist_id}","starred_url":"https://api.github.com/users/gspasov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gspasov/subscriptions","organizations_url":"https://api.github.com/users/gspasov/orgs","repos_url":"https://api.github.com/users/gspasov/repos","events_url":"https://api.github.com/users/gspasov/events{/privacy}","received_events_url":"https://api.github.com/users/gspasov/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":860555733,"url":"https://api.github.com/repos/aeternity/elixir-node/labels/spec-adjust","name":"spec-adjust","color":"e89561","default":false},{"id":864152763,"url":"https://api.github.com/repos/aeternity/elixir-node/labels/structures","name":"structures","color":"996eef","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/aeternity/elixir-node/pulls/290/commits","review_comments_url":"https://api.github.com/repos/aeternity/elixir-node/pulls/290/comments","review_comment_url":"https://api.github.com/repos/aeternity/elixir-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aeternity/elixir-node/issues/290/comments","statuses_url":"https://api.github.com/repos/aeternity/elixir-node/statuses/1c9ffd0899f3c8145da36b0179283b89f0dfdcf5","head":{"label":"aeternity:GH-256","ref":"GH-256","sha":"1c9ffd0899f3c8145da36b0179283b89f0dfdcf5","user":{"login":"aeternity","id":21989234,"avatar_url":"https://avatars1.githubusercontent.com/u/21989234?v=4","gravatar_id":"","url":"https://api.github.com/users/aeternity","html_url":"https://github.com/aeternity","followers_url":"https://api.github.com/users/aeternity/followers","following_url":"https://api.github.com/users/aeternity/following{/other_user}","gists_url":"https://api.github.com/users/aeternity/gists{/gist_id}","starred_url":"https://api.github.com/users/aeternity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeternity/subscriptions","organizations_url":"https://api.github.com/users/aeternity/orgs","repos_url":"https://api.github.com/users/aeternity/repos","events_url":"https://api.github.com/users/aeternity/events{/privacy}","received_events_url":"https://api.github.com/users/aeternity/received_events","type":"Organization","site_admin":false},"repo":{"id":102751238,"name":"elixir-node","full_name":"aeternity/elixir-node","owner":{"login":"aeternity","id":21989234,"avatar_url":"https://avatars1.githubusercontent.com/u/21989234?v=4","gravatar_id":"","url":"https://api.github.com/users/aeternity","html_url":"https://github.com/aeternity","followers_url":"https://api.github.com/users/aeternity/followers","following_url":"https://api.github.com/users/aeternity/following{/other_user}","gists_url":"https://api.github.com/users/aeternity/gists{/gist_id}","starred_url":"https://api.github.com/users/aeternity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeternity/subscriptions","organizations_url":"https://api.github.com/users/aeternity/orgs","repos_url":"https://api.github.com/users/aeternity/repos","events_url":"https://api.github.com/users/aeternity/events{/privacy}","received_events_url":"https://api.github.com/users/aeternity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aeternity/elixir-node","description":"Elixir full node implementation of the aeternity specification","fork":false,"url":"https://api.github.com/repos/aeternity/elixir-node","forks_url":"https://api.github.com/repos/aeternity/elixir-node/forks","keys_url":"https://api.github.com/repos/aeternity/elixir-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aeternity/elixir-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aeternity/elixir-node/teams","hooks_url":"https://api.github.com/repos/aeternity/elixir-node/hooks","issue_events_url":"https://api.github.com/repos/aeternity/elixir-node/issues/events{/number}","events_url":"https://api.github.com/repos/aeternity/elixir-node/events","assignees_url":"https://api.github.com/repos/aeternity/elixir-node/assignees{/user}","branches_url":"https://api.github.com/repos/aeternity/elixir-node/branches{/branch}","tags_url":"https://api.github.com/repos/aeternity/elixir-node/tags","blobs_url":"https://api.github.com/repos/aeternity/elixir-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aeternity/elixir-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aeternity/elixir-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/aeternity/elixir-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aeternity/elixir-node/statuses/{sha}","languages_url":"https://api.github.com/repos/aeternity/elixir-node/languages","stargazers_url":"https://api.github.com/repos/aeternity/elixir-node/stargazers","contributors_url":"https://api.github.com/repos/aeternity/elixir-node/contributors","subscribers_url":"https://api.github.com/repos/aeternity/elixir-node/subscribers","subscription_url":"https://api.github.com/repos/aeternity/elixir-node/subscription","commits_url":"https://api.github.com/repos/aeternity/elixir-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/aeternity/elixir-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/aeternity/elixir-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/aeternity/elixir-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/aeternity/elixir-node/contents/{+path}","compare_url":"https://api.github.com/repos/aeternity/elixir-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aeternity/elixir-node/merges","archive_url":"https://api.github.com/repos/aeternity/elixir-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aeternity/elixir-node/downloads","issues_url":"https://api.github.com/repos/aeternity/elixir-node/issues{/number}","pulls_url":"https://api.github.com/repos/aeternity/elixir-node/pulls{/number}","milestones_url":"https://api.github.com/repos/aeternity/elixir-node/milestones{/number}","notifications_url":"https://api.github.com/repos/aeternity/elixir-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aeternity/elixir-node/labels{/name}","releases_url":"https://api.github.com/repos/aeternity/elixir-node/releases{/id}","deployments_url":"https://api.github.com/repos/aeternity/elixir-node/deployments","created_at":"2017-09-07T15:04:18Z","updated_at":"2018-03-19T13:13:15Z","pushed_at":"2018-03-19T13:29:45Z","git_url":"git://github.com/aeternity/elixir-node.git","ssh_url":"git@github.com:aeternity/elixir-node.git","clone_url":"https://github.com/aeternity/elixir-node.git","svn_url":"https://github.com/aeternity/elixir-node","homepage":"","size":1659,"stargazers_count":104,"watchers_count":104,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc"},"forks":23,"open_issues":36,"watchers":104,"default_branch":"master"}},"base":{"label":"aeternity:master","ref":"master","sha":"6b69e47759f249fdf52036e54c156c454dbe0684","user":{"login":"aeternity","id":21989234,"avatar_url":"https://avatars1.githubusercontent.com/u/21989234?v=4","gravatar_id":"","url":"https://api.github.com/users/aeternity","html_url":"https://github.com/aeternity","followers_url":"https://api.github.com/users/aeternity/followers","following_url":"https://api.github.com/users/aeternity/following{/other_user}","gists_url":"https://api.github.com/users/aeternity/gists{/gist_id}","starred_url":"https://api.github.com/users/aeternity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeternity/subscriptions","organizations_url":"https://api.github.com/users/aeternity/orgs","repos_url":"https://api.github.com/users/aeternity/repos","events_url":"https://api.github.com/users/aeternity/events{/privacy}","received_events_url":"https://api.github.com/users/aeternity/received_events","type":"Organization","site_admin":false},"repo":{"id":102751238,"name":"elixir-node","full_name":"aeternity/elixir-node","owner":{"login":"aeternity","id":21989234,"avatar_url":"https://avatars1.githubusercontent.com/u/21989234?v=4","gravatar_id":"","url":"https://api.github.com/users/aeternity","html_url":"https://github.com/aeternity","followers_url":"https://api.github.com/users/aeternity/followers","following_url":"https://api.github.com/users/aeternity/following{/other_user}","gists_url":"https://api.github.com/users/aeternity/gists{/gist_id}","starred_url":"https://api.github.com/users/aeternity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aeternity/subscriptions","organizations_url":"https://api.github.com/users/aeternity/orgs","repos_url":"https://api.github.com/users/aeternity/repos","events_url":"https://api.github.com/users/aeternity/events{/privacy}","received_events_url":"https://api.github.com/users/aeternity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aeternity/elixir-node","description":"Elixir full node implementation of the aeternity specification","fork":false,"url":"https://api.github.com/repos/aeternity/elixir-node","forks_url":"https://api.github.com/repos/aeternity/elixir-node/forks","keys_url":"https://api.github.com/repos/aeternity/elixir-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aeternity/elixir-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aeternity/elixir-node/teams","hooks_url":"https://api.github.com/repos/aeternity/elixir-node/hooks","issue_events_url":"https://api.github.com/repos/aeternity/elixir-node/issues/events{/number}","events_url":"https://api.github.com/repos/aeternity/elixir-node/events","assignees_url":"https://api.github.com/repos/aeternity/elixir-node/assignees{/user}","branches_url":"https://api.github.com/repos/aeternity/elixir-node/branches{/branch}","tags_url":"https://api.github.com/repos/aeternity/elixir-node/tags","blobs_url":"https://api.github.com/repos/aeternity/elixir-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aeternity/elixir-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aeternity/elixir-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/aeternity/elixir-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aeternity/elixir-node/statuses/{sha}","languages_url":"https://api.github.com/repos/aeternity/elixir-node/languages","stargazers_url":"https://api.github.com/repos/aeternity/elixir-node/stargazers","contributors_url":"https://api.github.com/repos/aeternity/elixir-node/contributors","subscribers_url":"https://api.github.com/repos/aeternity/elixir-node/subscribers","subscription_url":"https://api.github.com/repos/aeternity/elixir-node/subscription","commits_url":"https://api.github.com/repos/aeternity/elixir-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/aeternity/elixir-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/aeternity/elixir-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/aeternity/elixir-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/aeternity/elixir-node/contents/{+path}","compare_url":"https://api.github.com/repos/aeternity/elixir-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aeternity/elixir-node/merges","archive_url":"https://api.github.com/repos/aeternity/elixir-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aeternity/elixir-node/downloads","issues_url":"https://api.github.com/repos/aeternity/elixir-node/issues{/number}","pulls_url":"https://api.github.com/repos/aeternity/elixir-node/pulls{/number}","milestones_url":"https://api.github.com/repos/aeternity/elixir-node/milestones{/number}","notifications_url":"https://api.github.com/repos/aeternity/elixir-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aeternity/elixir-node/labels{/name}","releases_url":"https://api.github.com/repos/aeternity/elixir-node/releases{/id}","deployments_url":"https://api.github.com/repos/aeternity/elixir-node/deployments","created_at":"2017-09-07T15:04:18Z","updated_at":"2018-03-19T13:13:15Z","pushed_at":"2018-03-19T13:29:45Z","git_url":"git://github.com/aeternity/elixir-node.git","ssh_url":"git@github.com:aeternity/elixir-node.git","clone_url":"https://github.com/aeternity/elixir-node.git","svn_url":"https://github.com/aeternity/elixir-node","homepage":"","size":1659,"stargazers_count":104,"watchers_count":104,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc"},"forks":23,"open_issues":36,"watchers":104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aeternity/elixir-node/pulls/290"},"html":{"href":"https://github.com/aeternity/elixir-node/pull/290"},"issue":{"href":"https://api.github.com/repos/aeternity/elixir-node/issues/290"},"comments":{"href":"https://api.github.com/repos/aeternity/elixir-node/issues/290/comments"},"review_comments":{"href":"https://api.github.com/repos/aeternity/elixir-node/pulls/290/comments"},"review_comment":{"href":"https://api.github.com/repos/aeternity/elixir-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aeternity/elixir-node/pulls/290/commits"},"statuses":{"href":"https://api.github.com/repos/aeternity/elixir-node/statuses/1c9ffd0899f3c8145da36b0179283b89f0dfdcf5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"thepiwo"}}