{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/coding-horror/ascii85/pulls/2","id":92859074,"html_url":"https://github.com/coding-horror/ascii85/pull/2","diff_url":"https://github.com/coding-horror/ascii85/pull/2.diff","patch_url":"https://github.com/coding-horror/ascii85/pull/2.patch","issue_url":"https://api.github.com/repos/coding-horror/ascii85/issues/2","number":2,"state":"open","locked":false,"title":"Calling Decode multiple times from same instance corrupted results","user":{"login":"cyotek","id":859574,"avatar_url":"https://avatars.githubusercontent.com/u/859574?v=3","gravatar_id":"","url":"https://api.github.com/users/cyotek","html_url":"https://github.com/cyotek","followers_url":"https://api.github.com/users/cyotek/followers","following_url":"https://api.github.com/users/cyotek/following{/other_user}","gists_url":"https://api.github.com/users/cyotek/gists{/gist_id}","starred_url":"https://api.github.com/users/cyotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyotek/subscriptions","organizations_url":"https://api.github.com/users/cyotek/orgs","repos_url":"https://api.github.com/users/cyotek/repos","events_url":"https://api.github.com/users/cyotek/events{/privacy}","received_events_url":"https://api.github.com/users/cyotek/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nI was playing around with your `Ascii85` implementation when I discovered that calling `Decode` multiple times from the same `Ascii85` instance would cause data corruption on successive calls. For example, the following output was generated by changing `TestString` to call and print `Decode` twice\r\n\r\n````\r\n<~9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKF<GL>Cj@.4Gp$d7F!,L7@<6@)/0JDEF<G%<+EV:2F!,\r\nO<DJ+*.@<*K0@<6L(Df-\\0Ec5e;DffZ(EZee.Bl.9pF\"AGXBPCsi+DGm>@3BB/F*&OCAfu2/AKY\r\ni(DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF<G:8+EV:.+Cf>-FD5W8ARlolDIa\r\nl(DId<j@<?3r@:F%a+D58'ATD4$Bl@l3De:,-DJs`8ARoFb/0JMK@qB4^F!,R<AKZ&-DfTqBG%G\r\n>uD.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c~>\r\n\r\nEncoded in 345 chars\r\n\r\nMan is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.\r\n\r\nDecoded 269 chars\r\n\r\n{d??is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.\r\n````\r\n\r\nYou can see the first few characters in the second call have been corrupted. I first spotted this when storing encoded passwords in an XML file then wondering why they weren't working anymore after successive saves :)\r\n\r\nFortunately the fix was simple - so simple it seems a little absurd creating a pull request (especially given it was a demo to accompany your blog post), but that seems to be the GitHub way. Basically, the `Decode` method needs to reset the `_tuple` instance variable back to `0` prior to doing its thing, and successive calls then work fine without the corruption. (At least I hope so, I haven't really grokked how it truly works).\r\n\r\nThanks for providing the helpful class!\r\n\r\nRegards;\r\nRichard Moss","created_at":"2016-11-08T21:08:30Z","updated_at":"2016-11-08T21:08:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coding-horror/ascii85/pulls/2/commits","review_comments_url":"https://api.github.com/repos/coding-horror/ascii85/pulls/2/comments","review_comment_url":"https://api.github.com/repos/coding-horror/ascii85/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coding-horror/ascii85/issues/2/comments","statuses_url":"https://api.github.com/repos/coding-horror/ascii85/statuses/ba33322b3ff665d3cefaaa177300e049f43137ab","head":{"label":"cyotek:DecodeFix","ref":"DecodeFix","sha":"ba33322b3ff665d3cefaaa177300e049f43137ab","user":{"login":"cyotek","id":859574,"avatar_url":"https://avatars.githubusercontent.com/u/859574?v=3","gravatar_id":"","url":"https://api.github.com/users/cyotek","html_url":"https://github.com/cyotek","followers_url":"https://api.github.com/users/cyotek/followers","following_url":"https://api.github.com/users/cyotek/following{/other_user}","gists_url":"https://api.github.com/users/cyotek/gists{/gist_id}","starred_url":"https://api.github.com/users/cyotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyotek/subscriptions","organizations_url":"https://api.github.com/users/cyotek/orgs","repos_url":"https://api.github.com/users/cyotek/repos","events_url":"https://api.github.com/users/cyotek/events{/privacy}","received_events_url":"https://api.github.com/users/cyotek/received_events","type":"User","site_admin":false},"repo":{"id":73225306,"name":"ascii85","full_name":"cyotek/ascii85","owner":{"login":"cyotek","id":859574,"avatar_url":"https://avatars.githubusercontent.com/u/859574?v=3","gravatar_id":"","url":"https://api.github.com/users/cyotek","html_url":"https://github.com/cyotek","followers_url":"https://api.github.com/users/cyotek/followers","following_url":"https://api.github.com/users/cyotek/following{/other_user}","gists_url":"https://api.github.com/users/cyotek/gists{/gist_id}","starred_url":"https://api.github.com/users/cyotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyotek/subscriptions","organizations_url":"https://api.github.com/users/cyotek/orgs","repos_url":"https://api.github.com/users/cyotek/repos","events_url":"https://api.github.com/users/cyotek/events{/privacy}","received_events_url":"https://api.github.com/users/cyotek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cyotek/ascii85","description":"a c# implementation of an ascii85 text encoding algorithm","fork":true,"url":"https://api.github.com/repos/cyotek/ascii85","forks_url":"https://api.github.com/repos/cyotek/ascii85/forks","keys_url":"https://api.github.com/repos/cyotek/ascii85/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyotek/ascii85/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyotek/ascii85/teams","hooks_url":"https://api.github.com/repos/cyotek/ascii85/hooks","issue_events_url":"https://api.github.com/repos/cyotek/ascii85/issues/events{/number}","events_url":"https://api.github.com/repos/cyotek/ascii85/events","assignees_url":"https://api.github.com/repos/cyotek/ascii85/assignees{/user}","branches_url":"https://api.github.com/repos/cyotek/ascii85/branches{/branch}","tags_url":"https://api.github.com/repos/cyotek/ascii85/tags","blobs_url":"https://api.github.com/repos/cyotek/ascii85/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyotek/ascii85/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyotek/ascii85/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyotek/ascii85/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyotek/ascii85/statuses/{sha}","languages_url":"https://api.github.com/repos/cyotek/ascii85/languages","stargazers_url":"https://api.github.com/repos/cyotek/ascii85/stargazers","contributors_url":"https://api.github.com/repos/cyotek/ascii85/contributors","subscribers_url":"https://api.github.com/repos/cyotek/ascii85/subscribers","subscription_url":"https://api.github.com/repos/cyotek/ascii85/subscription","commits_url":"https://api.github.com/repos/cyotek/ascii85/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyotek/ascii85/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyotek/ascii85/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyotek/ascii85/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyotek/ascii85/contents/{+path}","compare_url":"https://api.github.com/repos/cyotek/ascii85/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyotek/ascii85/merges","archive_url":"https://api.github.com/repos/cyotek/ascii85/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyotek/ascii85/downloads","issues_url":"https://api.github.com/repos/cyotek/ascii85/issues{/number}","pulls_url":"https://api.github.com/repos/cyotek/ascii85/pulls{/number}","milestones_url":"https://api.github.com/repos/cyotek/ascii85/milestones{/number}","notifications_url":"https://api.github.com/repos/cyotek/ascii85/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyotek/ascii85/labels{/name}","releases_url":"https://api.github.com/repos/cyotek/ascii85/releases{/id}","deployments_url":"https://api.github.com/repos/cyotek/ascii85/deployments","created_at":"2016-11-08T20:42:04Z","updated_at":"2016-11-08T20:42:06Z","pushed_at":"2016-11-08T20:52:01Z","git_url":"git://github.com/cyotek/ascii85.git","ssh_url":"git@github.com:cyotek/ascii85.git","clone_url":"https://github.com/cyotek/ascii85.git","svn_url":"https://github.com/cyotek/ascii85","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coding-horror:master","ref":"master","sha":"c96c3e430bedcd36eeb679d98607bf92e9b2b6b2","user":{"login":"coding-horror","id":1522517,"avatar_url":"https://avatars.githubusercontent.com/u/1522517?v=3","gravatar_id":"","url":"https://api.github.com/users/coding-horror","html_url":"https://github.com/coding-horror","followers_url":"https://api.github.com/users/coding-horror/followers","following_url":"https://api.github.com/users/coding-horror/following{/other_user}","gists_url":"https://api.github.com/users/coding-horror/gists{/gist_id}","starred_url":"https://api.github.com/users/coding-horror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coding-horror/subscriptions","organizations_url":"https://api.github.com/users/coding-horror/orgs","repos_url":"https://api.github.com/users/coding-horror/repos","events_url":"https://api.github.com/users/coding-horror/events{/privacy}","received_events_url":"https://api.github.com/users/coding-horror/received_events","type":"User","site_admin":false},"repo":{"id":26137900,"name":"ascii85","full_name":"coding-horror/ascii85","owner":{"login":"coding-horror","id":1522517,"avatar_url":"https://avatars.githubusercontent.com/u/1522517?v=3","gravatar_id":"","url":"https://api.github.com/users/coding-horror","html_url":"https://github.com/coding-horror","followers_url":"https://api.github.com/users/coding-horror/followers","following_url":"https://api.github.com/users/coding-horror/following{/other_user}","gists_url":"https://api.github.com/users/coding-horror/gists{/gist_id}","starred_url":"https://api.github.com/users/coding-horror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coding-horror/subscriptions","organizations_url":"https://api.github.com/users/coding-horror/orgs","repos_url":"https://api.github.com/users/coding-horror/repos","events_url":"https://api.github.com/users/coding-horror/events{/privacy}","received_events_url":"https://api.github.com/users/coding-horror/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coding-horror/ascii85","description":"a c# implementation of an ascii85 text encoding algorithm","fork":false,"url":"https://api.github.com/repos/coding-horror/ascii85","forks_url":"https://api.github.com/repos/coding-horror/ascii85/forks","keys_url":"https://api.github.com/repos/coding-horror/ascii85/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coding-horror/ascii85/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coding-horror/ascii85/teams","hooks_url":"https://api.github.com/repos/coding-horror/ascii85/hooks","issue_events_url":"https://api.github.com/repos/coding-horror/ascii85/issues/events{/number}","events_url":"https://api.github.com/repos/coding-horror/ascii85/events","assignees_url":"https://api.github.com/repos/coding-horror/ascii85/assignees{/user}","branches_url":"https://api.github.com/repos/coding-horror/ascii85/branches{/branch}","tags_url":"https://api.github.com/repos/coding-horror/ascii85/tags","blobs_url":"https://api.github.com/repos/coding-horror/ascii85/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coding-horror/ascii85/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coding-horror/ascii85/git/refs{/sha}","trees_url":"https://api.github.com/repos/coding-horror/ascii85/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coding-horror/ascii85/statuses/{sha}","languages_url":"https://api.github.com/repos/coding-horror/ascii85/languages","stargazers_url":"https://api.github.com/repos/coding-horror/ascii85/stargazers","contributors_url":"https://api.github.com/repos/coding-horror/ascii85/contributors","subscribers_url":"https://api.github.com/repos/coding-horror/ascii85/subscribers","subscription_url":"https://api.github.com/repos/coding-horror/ascii85/subscription","commits_url":"https://api.github.com/repos/coding-horror/ascii85/commits{/sha}","git_commits_url":"https://api.github.com/repos/coding-horror/ascii85/git/commits{/sha}","comments_url":"https://api.github.com/repos/coding-horror/ascii85/comments{/number}","issue_comment_url":"https://api.github.com/repos/coding-horror/ascii85/issues/comments{/number}","contents_url":"https://api.github.com/repos/coding-horror/ascii85/contents/{+path}","compare_url":"https://api.github.com/repos/coding-horror/ascii85/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coding-horror/ascii85/merges","archive_url":"https://api.github.com/repos/coding-horror/ascii85/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coding-horror/ascii85/downloads","issues_url":"https://api.github.com/repos/coding-horror/ascii85/issues{/number}","pulls_url":"https://api.github.com/repos/coding-horror/ascii85/pulls{/number}","milestones_url":"https://api.github.com/repos/coding-horror/ascii85/milestones{/number}","notifications_url":"https://api.github.com/repos/coding-horror/ascii85/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coding-horror/ascii85/labels{/name}","releases_url":"https://api.github.com/repos/coding-horror/ascii85/releases{/id}","deployments_url":"https://api.github.com/repos/coding-horror/ascii85/deployments","created_at":"2014-11-03T20:45:20Z","updated_at":"2016-08-03T21:03:04Z","pushed_at":"2016-11-08T21:08:30Z","git_url":"git://github.com/coding-horror/ascii85.git","ssh_url":"git@github.com:coding-horror/ascii85.git","clone_url":"https://github.com/coding-horror/ascii85.git","svn_url":"https://github.com/coding-horror/ascii85","homepage":null,"size":5,"stargazers_count":7,"watchers_count":7,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coding-horror/ascii85/pulls/2"},"html":{"href":"https://github.com/coding-horror/ascii85/pull/2"},"issue":{"href":"https://api.github.com/repos/coding-horror/ascii85/issues/2"},"comments":{"href":"https://api.github.com/repos/coding-horror/ascii85/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/coding-horror/ascii85/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/coding-horror/ascii85/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coding-horror/ascii85/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/coding-horror/ascii85/statuses/ba33322b3ff665d3cefaaa177300e049f43137ab"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"cyotek"}}