{"action":"created","comment":{"url":"https://api.github.com/repos/multiformats/go-multihash/pulls/comments/214199974","pull_request_review_id":151205409,"id":214199974,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDE5OTk3NA==","diff_hunk":"@@ -227,6 +229,36 @@ func FromB58String(s string) (m Multihash, err error) {\n \treturn Cast(b)\n }\n \n+// FromBinary creates a new multihash from the binary\n+// representation. The string is assumed to be a valid multihash.\n+// This function will not alloc and will panic if it is unable to\n+// parse the string.\n+func FromBinary(v string) Multihash {\n+\t// Sanity check that the string can be parsed.\n+\tif len(v) < 2 {\n+\t\tpanic(ErrTooShort)\n+\t}\n+\ti := strbinary.UvarintLen(v)\n+\tdigestLen, l := strbinary.Uvarint(v[i:])\n+\ti += l\n+\tif len(v[i:]) != int(digestLen) {\n+\t\tpanic(ErrInvalidMultihash)\n+\t}\n+\treturn Multihash{v}\n+}\n+\n+// Parts returns the components of the Multihash (Code, Name, Digest)","path":"multihash.go","position":31,"original_position":31,"commit_id":"4e40cd13741fe8301698ad2284d542c10b2a11ab","original_commit_id":"4e40cd13741fe8301698ad2284d542c10b2a11ab","user":{"login":"kevina","id":1271492,"node_id":"MDQ6VXNlcjEyNzE0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1271492?v=4","gravatar_id":"","url":"https://api.github.com/users/kevina","html_url":"https://github.com/kevina","followers_url":"https://api.github.com/users/kevina/followers","following_url":"https://api.github.com/users/kevina/following{/other_user}","gists_url":"https://api.github.com/users/kevina/gists{/gist_id}","starred_url":"https://api.github.com/users/kevina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevina/subscriptions","organizations_url":"https://api.github.com/users/kevina/orgs","repos_url":"https://api.github.com/users/kevina/repos","events_url":"https://api.github.com/users/kevina/events{/privacy}","received_events_url":"https://api.github.com/users/kevina/received_events","type":"User","site_admin":false},"body":"Yeah your right since the length is primary useful in the binary representation as a sanity check and to know when the multihash ends in a byte stream.","created_at":"2018-08-30T22:28:01Z","updated_at":"2018-08-30T22:28:01Z","html_url":"https://github.com/multiformats/go-multihash/pull/84#discussion_r214199974","pull_request_url":"https://api.github.com/repos/multiformats/go-multihash/pulls/84","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/multiformats/go-multihash/pulls/comments/214199974"},"html":{"href":"https://github.com/multiformats/go-multihash/pull/84#discussion_r214199974"},"pull_request":{"href":"https://api.github.com/repos/multiformats/go-multihash/pulls/84"}},"in_reply_to_id":214134054},"pull_request":{"url":"https://api.github.com/repos/multiformats/go-multihash/pulls/84","id":212149741,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMTQ5NzQx","html_url":"https://github.com/multiformats/go-multihash/pull/84","diff_url":"https://github.com/multiformats/go-multihash/pull/84.diff","patch_url":"https://github.com/multiformats/go-multihash/pull/84.patch","issue_url":"https://api.github.com/repos/multiformats/go-multihash/issues/84","number":84,"state":"open","locked":false,"title":"continuation of conversion of multihash to string","user":{"login":"kevina","id":1271492,"node_id":"MDQ6VXNlcjEyNzE0OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1271492?v=4","gravatar_id":"","url":"https://api.github.com/users/kevina","html_url":"https://github.com/kevina","followers_url":"https://api.github.com/users/kevina/followers","following_url":"https://api.github.com/users/kevina/following{/other_user}","gists_url":"https://api.github.com/users/kevina/gists{/gist_id}","starred_url":"https://api.github.com/users/kevina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevina/subscriptions","organizations_url":"https://api.github.com/users/kevina/orgs","repos_url":"https://api.github.com/users/kevina/repos","events_url":"https://api.github.com/users/kevina/events{/privacy}","received_events_url":"https://api.github.com/users/kevina/received_events","type":"User","site_admin":false},"body":"Continuation of #83 using parts of #82.\r\n","created_at":"2018-08-30T17:09:32Z","updated_at":"2018-08-30T22:28:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03d443221ac24ba12e6528558aeeb65d6742c137","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1039685352,"node_id":"MDU6TGFiZWwxMDM5Njg1MzUy","url":"https://api.github.com/repos/multiformats/go-multihash/labels/backlog","name":"backlog","color":"ffffff","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/multiformats/go-multihash/pulls/84/commits","review_comments_url":"https://api.github.com/repos/multiformats/go-multihash/pulls/84/comments","review_comment_url":"https://api.github.com/repos/multiformats/go-multihash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/multiformats/go-multihash/issues/84/comments","statuses_url":"https://api.github.com/repos/multiformats/go-multihash/statuses/4e40cd13741fe8301698ad2284d542c10b2a11ab","head":{"label":"multiformats:kevina/steb-mh-string","ref":"kevina/steb-mh-string","sha":"4e40cd13741fe8301698ad2284d542c10b2a11ab","user":{"login":"multiformats","id":20296538,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjk2NTM4","avatar_url":"https://avatars2.githubusercontent.com/u/20296538?v=4","gravatar_id":"","url":"https://api.github.com/users/multiformats","html_url":"https://github.com/multiformats","followers_url":"https://api.github.com/users/multiformats/followers","following_url":"https://api.github.com/users/multiformats/following{/other_user}","gists_url":"https://api.github.com/users/multiformats/gists{/gist_id}","starred_url":"https://api.github.com/users/multiformats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/multiformats/subscriptions","organizations_url":"https://api.github.com/users/multiformats/orgs","repos_url":"https://api.github.com/users/multiformats/repos","events_url":"https://api.github.com/users/multiformats/events{/privacy}","received_events_url":"https://api.github.com/users/multiformats/received_events","type":"Organization","site_admin":false},"repo":{"id":20085120,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA4NTEyMA==","name":"go-multihash","full_name":"multiformats/go-multihash","owner":{"login":"multiformats","id":20296538,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjk2NTM4","avatar_url":"https://avatars2.githubusercontent.com/u/20296538?v=4","gravatar_id":"","url":"https://api.github.com/users/multiformats","html_url":"https://github.com/multiformats","followers_url":"https://api.github.com/users/multiformats/followers","following_url":"https://api.github.com/users/multiformats/following{/other_user}","gists_url":"https://api.github.com/users/multiformats/gists{/gist_id}","starred_url":"https://api.github.com/users/multiformats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/multiformats/subscriptions","organizations_url":"https://api.github.com/users/multiformats/orgs","repos_url":"https://api.github.com/users/multiformats/repos","events_url":"https://api.github.com/users/multiformats/events{/privacy}","received_events_url":"https://api.github.com/users/multiformats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/multiformats/go-multihash","description":"Multihash implementation in Go","fork":false,"url":"https://api.github.com/repos/multiformats/go-multihash","forks_url":"https://api.github.com/repos/multiformats/go-multihash/forks","keys_url":"https://api.github.com/repos/multiformats/go-multihash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/multiformats/go-multihash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/multiformats/go-multihash/teams","hooks_url":"https://api.github.com/repos/multiformats/go-multihash/hooks","issue_events_url":"https://api.github.com/repos/multiformats/go-multihash/issues/events{/number}","events_url":"https://api.github.com/repos/multiformats/go-multihash/events","assignees_url":"https://api.github.com/repos/multiformats/go-multihash/assignees{/user}","branches_url":"https://api.github.com/repos/multiformats/go-multihash/branches{/branch}","tags_url":"https://api.github.com/repos/multiformats/go-multihash/tags","blobs_url":"https://api.github.com/repos/multiformats/go-multihash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/multiformats/go-multihash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/multiformats/go-multihash/git/refs{/sha}","trees_url":"https://api.github.com/repos/multiformats/go-multihash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/multiformats/go-multihash/statuses/{sha}","languages_url":"https://api.github.com/repos/multiformats/go-multihash/languages","stargazers_url":"https://api.github.com/repos/multiformats/go-multihash/stargazers","contributors_url":"https://api.github.com/repos/multiformats/go-multihash/contributors","subscribers_url":"https://api.github.com/repos/multiformats/go-multihash/subscribers","subscription_url":"https://api.github.com/repos/multiformats/go-multihash/subscription","commits_url":"https://api.github.com/repos/multiformats/go-multihash/commits{/sha}","git_commits_url":"https://api.github.com/repos/multiformats/go-multihash/git/commits{/sha}","comments_url":"https://api.github.com/repos/multiformats/go-multihash/comments{/number}","issue_comment_url":"https://api.github.com/repos/multiformats/go-multihash/issues/comments{/number}","contents_url":"https://api.github.com/repos/multiformats/go-multihash/contents/{+path}","compare_url":"https://api.github.com/repos/multiformats/go-multihash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/multiformats/go-multihash/merges","archive_url":"https://api.github.com/repos/multiformats/go-multihash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/multiformats/go-multihash/downloads","issues_url":"https://api.github.com/repos/multiformats/go-multihash/issues{/number}","pulls_url":"https://api.github.com/repos/multiformats/go-multihash/pulls{/number}","milestones_url":"https://api.github.com/repos/multiformats/go-multihash/milestones{/number}","notifications_url":"https://api.github.com/repos/multiformats/go-multihash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/multiformats/go-multihash/labels{/name}","releases_url":"https://api.github.com/repos/multiformats/go-multihash/releases{/id}","deployments_url":"https://api.github.com/repos/multiformats/go-multihash/deployments","created_at":"2014-05-23T03:06:46Z","updated_at":"2018-08-29T07:22:51Z","pushed_at":"2018-08-30T17:09:33Z","git_url":"git://github.com/multiformats/go-multihash.git","ssh_url":"git@github.com:multiformats/go-multihash.git","clone_url":"https://github.com/multiformats/go-multihash.git","svn_url":"https://github.com/multiformats/go-multihash","homepage":"","size":141,"stargazers_count":102,"watchers_count":102,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":31,"open_issues":21,"watchers":102,"default_branch":"master"}},"base":{"label":"multiformats:feat/steb-mh-string","ref":"feat/steb-mh-string","sha":"23784ba48b52f0ae6b4ecdfe025d0931a4cf227c","user":{"login":"multiformats","id":20296538,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjk2NTM4","avatar_url":"https://avatars2.githubusercontent.com/u/20296538?v=4","gravatar_id":"","url":"https://api.github.com/users/multiformats","html_url":"https://github.com/multiformats","followers_url":"https://api.github.com/users/multiformats/followers","following_url":"https://api.github.com/users/multiformats/following{/other_user}","gists_url":"https://api.github.com/users/multiformats/gists{/gist_id}","starred_url":"https://api.github.com/users/multiformats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/multiformats/subscriptions","organizations_url":"https://api.github.com/users/multiformats/orgs","repos_url":"https://api.github.com/users/multiformats/repos","events_url":"https://api.github.com/users/multiformats/events{/privacy}","received_events_url":"https://api.github.com/users/multiformats/received_events","type":"Organization","site_admin":false},"repo":{"id":20085120,"node_id":"MDEwOlJlcG9zaXRvcnkyMDA4NTEyMA==","name":"go-multihash","full_name":"multiformats/go-multihash","owner":{"login":"multiformats","id":20296538,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjk2NTM4","avatar_url":"https://avatars2.githubusercontent.com/u/20296538?v=4","gravatar_id":"","url":"https://api.github.com/users/multiformats","html_url":"https://github.com/multiformats","followers_url":"https://api.github.com/users/multiformats/followers","following_url":"https://api.github.com/users/multiformats/following{/other_user}","gists_url":"https://api.github.com/users/multiformats/gists{/gist_id}","starred_url":"https://api.github.com/users/multiformats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/multiformats/subscriptions","organizations_url":"https://api.github.com/users/multiformats/orgs","repos_url":"https://api.github.com/users/multiformats/repos","events_url":"https://api.github.com/users/multiformats/events{/privacy}","received_events_url":"https://api.github.com/users/multiformats/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/multiformats/go-multihash","description":"Multihash implementation in Go","fork":false,"url":"https://api.github.com/repos/multiformats/go-multihash","forks_url":"https://api.github.com/repos/multiformats/go-multihash/forks","keys_url":"https://api.github.com/repos/multiformats/go-multihash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/multiformats/go-multihash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/multiformats/go-multihash/teams","hooks_url":"https://api.github.com/repos/multiformats/go-multihash/hooks","issue_events_url":"https://api.github.com/repos/multiformats/go-multihash/issues/events{/number}","events_url":"https://api.github.com/repos/multiformats/go-multihash/events","assignees_url":"https://api.github.com/repos/multiformats/go-multihash/assignees{/user}","branches_url":"https://api.github.com/repos/multiformats/go-multihash/branches{/branch}","tags_url":"https://api.github.com/repos/multiformats/go-multihash/tags","blobs_url":"https://api.github.com/repos/multiformats/go-multihash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/multiformats/go-multihash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/multiformats/go-multihash/git/refs{/sha}","trees_url":"https://api.github.com/repos/multiformats/go-multihash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/multiformats/go-multihash/statuses/{sha}","languages_url":"https://api.github.com/repos/multiformats/go-multihash/languages","stargazers_url":"https://api.github.com/repos/multiformats/go-multihash/stargazers","contributors_url":"https://api.github.com/repos/multiformats/go-multihash/contributors","subscribers_url":"https://api.github.com/repos/multiformats/go-multihash/subscribers","subscription_url":"https://api.github.com/repos/multiformats/go-multihash/subscription","commits_url":"https://api.github.com/repos/multiformats/go-multihash/commits{/sha}","git_commits_url":"https://api.github.com/repos/multiformats/go-multihash/git/commits{/sha}","comments_url":"https://api.github.com/repos/multiformats/go-multihash/comments{/number}","issue_comment_url":"https://api.github.com/repos/multiformats/go-multihash/issues/comments{/number}","contents_url":"https://api.github.com/repos/multiformats/go-multihash/contents/{+path}","compare_url":"https://api.github.com/repos/multiformats/go-multihash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/multiformats/go-multihash/merges","archive_url":"https://api.github.com/repos/multiformats/go-multihash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/multiformats/go-multihash/downloads","issues_url":"https://api.github.com/repos/multiformats/go-multihash/issues{/number}","pulls_url":"https://api.github.com/repos/multiformats/go-multihash/pulls{/number}","milestones_url":"https://api.github.com/repos/multiformats/go-multihash/milestones{/number}","notifications_url":"https://api.github.com/repos/multiformats/go-multihash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/multiformats/go-multihash/labels{/name}","releases_url":"https://api.github.com/repos/multiformats/go-multihash/releases{/id}","deployments_url":"https://api.github.com/repos/multiformats/go-multihash/deployments","created_at":"2014-05-23T03:06:46Z","updated_at":"2018-08-29T07:22:51Z","pushed_at":"2018-08-30T17:09:33Z","git_url":"git://github.com/multiformats/go-multihash.git","ssh_url":"git@github.com:multiformats/go-multihash.git","clone_url":"https://github.com/multiformats/go-multihash.git","svn_url":"https://github.com/multiformats/go-multihash","homepage":"","size":141,"stargazers_count":102,"watchers_count":102,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":31,"open_issues":21,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/multiformats/go-multihash/pulls/84"},"html":{"href":"https://github.com/multiformats/go-multihash/pull/84"},"issue":{"href":"https://api.github.com/repos/multiformats/go-multihash/issues/84"},"comments":{"href":"https://api.github.com/repos/multiformats/go-multihash/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/multiformats/go-multihash/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/multiformats/go-multihash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/multiformats/go-multihash/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/multiformats/go-multihash/statuses/4e40cd13741fe8301698ad2284d542c10b2a11ab"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kevina"}}