{"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments/48515517","id":48515517,"diff_hunk":"@@ -24,59 +17,61 @@ code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD\n category 'computing_tools';\n topics 'cryptography';\n \n-attribution github => ['https://github.com/digit4lfa1l', 'digit4lfa1l'];\n+attribution github => ['https://github.com/digit4lfa1l', 'digit4lfa1l'],\n+            github => [\"https://github.com/Mailkov\", \"Melchiorre Alastra\"];\n \n-# Remainder function with links to the Wikipedia resources.\n+my %cryptohash = (\n+    128 => \"MD5\",\n+    160 => \"SHA-1\",\n+    224 => \"SHA-2/SHA-3\",\n+    256 => \"SHA-2/SHA-3\",\n+    384 => \"SHA-2/SHA-3\",\n+    512 => \"SHA-2/SHA-3\"\n+);\n \n+# Remainder function with links to the Wikipedia resources.\n handle remainder => sub {\n-\tmy ($md5) = /^[0-9a-f]{32}$/i;\n-\t\tif ($md5){\n-\t\t  \tmy $text = sprintf qq(This is a 128 bit MD5 cryptographic hash.);\n-  \t\t\tmy $html = sprintf qq(This is a 128 bit <a href=\"%s\">MD5</a> cryptographic hash.),MD5HERF;\n-\n-\t\t\treturn $text, html => $html;\n-\t\t}\n-\n-\tmy ($sha1)  = /^[0-9a-f]{40}$/i;\n-\t\tif ($sha1){\n-\t\t  \tmy $text = sprintf qq(This is a 160 bit SHA-1 cryptographic hash.);\n-  \t\t\tmy $html = sprintf qq(This is a 160 bit <a href=\"%s\">SHA-1</a> cryptographic hash.),SHA1HREF;\n-\n-\t\t\treturn $text, html => $html;\n-\t\t}\n-\n-\tmy ($sha224) = /^[0-9a-f]{56}$/i;\n-\t\tif ($sha224){\n-\t\t  \tmy $text = sprintf qq(This is a 224 bit SHA-2/SHA-3 cryptographic hash.);\n-  \t\t\tmy $html = sprintf qq(This is a 224 bit <a href=\"%s\">SHA-2</a>/<a href=\"%s\">SHA-3</a> cryptographic hash.),SHA2HREF,SHA3HREF;\n-\n-\t\t\treturn $text, html => $html;\n-\t\t}\n-\n-\tmy ($sha256) = /^[0-9a-f]{64}$/i;\n-\t\tif ($sha256){\n-\t\t  \tmy $text = sprintf qq(This is a 256 bit SHA-2/SHA-3 cryptographic hash.);\n-  \t\t\tmy $html = sprintf qq(This is a 256 bit <a href=\"%s\">SHA-2</a>/<a href=\"%s\">SHA-3</a> cryptographic hash.),SHA2HREF,SHA3HREF;\n-\n-\t\t\treturn $text, html => $html;\n-\t\t}\n-\n-\tmy ($sha384) = /^[0-9a-f]{96}$/i;\n-\t\tif ($sha384){\n-\t\t  \tmy $text = sprintf qq(This is a 384 bit SHA-2/SHA-3 cryptographic hash.);\n-  \t\t\tmy $html = sprintf qq(This is a 384 bit <a href=\"%s\">SHA-2</a>/<a href=\"%s\">SHA-3</a> cryptographic hash.),SHA2HREF,SHA3HREF;\n-\n-\t\t\treturn $text, html => $html;\n-\t\t}\n \n-\tmy ($sha512) = /^[0-9a-f]{128}$/i;\n-\t\tif ($sha512){\n-\t\t  \tmy $text = sprintf qq(This is a 512 bit SHA-2/SHA-3 cryptographic hash.);\n-  \t\t\tmy $html = sprintf qq(This is a 512 bit <a href=\"%s\">SHA-2</a>/<a href=\"%s\">SHA-3</a> cryptographic hash.),SHA2HREF,SHA3HREF;\n+    return unless /^[0-9a-f]{32}$|^[0-9a-f]{40}$|^[0-9a-f]{56}$|^[0-9a-f]{64}$|^[0-9a-f]{96}$|^[0-9a-f]{128}$/i;","path":"lib/DDG/Goodie/CryptHashCheck.pm","position":80,"original_position":80,"commit_id":"b06eb94152cad719677c49f7d8a1bd226888dffb","original_commit_id":"b06eb94152cad719677c49f7d8a1bd226888dffb","user":{"login":"mintsoft","id":978048,"avatar_url":"https://avatars.githubusercontent.com/u/978048?v=3","gravatar_id":"","url":"https://api.github.com/users/mintsoft","html_url":"https://github.com/mintsoft","followers_url":"https://api.github.com/users/mintsoft/followers","following_url":"https://api.github.com/users/mintsoft/following{/other_user}","gists_url":"https://api.github.com/users/mintsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mintsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mintsoft/subscriptions","organizations_url":"https://api.github.com/users/mintsoft/orgs","repos_url":"https://api.github.com/users/mintsoft/repos","events_url":"https://api.github.com/users/mintsoft/events{/privacy}","received_events_url":"https://api.github.com/users/mintsoft/received_events","type":"User","site_admin":false},"body":"Hmm, it might be cleaner/faster to just do:\r\n```perl\r\n$matches = /^([0-9A-Fa-f]{32,128})$/;\r\nmy $chars = 4 * length($1);\r\nreturn unless defined $cryptohash{$chars};\r\n```\r\n\r\nI'm not totally convinced that it's better, however all the `or`s in the regex bothers me for some reason","created_at":"2015-12-29T00:41:33Z","updated_at":"2015-12-29T00:41:33Z","html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1978#discussion_r48515517","pull_request_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments/48515517"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1978#discussion_r48515517"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978","id":54664404,"html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1978","diff_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1978.diff","patch_url":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1978.patch","issue_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1978","number":1978,"state":"open","locked":false,"title":"Issue #1163 - Convert CryptHashCheck to use templates","user":{"login":"Mailkov","id":10259499,"avatar_url":"https://avatars.githubusercontent.com/u/10259499?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailkov","html_url":"https://github.com/Mailkov","followers_url":"https://api.github.com/users/Mailkov/followers","following_url":"https://api.github.com/users/Mailkov/following{/other_user}","gists_url":"https://api.github.com/users/Mailkov/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailkov/subscriptions","organizations_url":"https://api.github.com/users/Mailkov/orgs","repos_url":"https://api.github.com/users/Mailkov/repos","events_url":"https://api.github.com/users/Mailkov/events{/privacy}","received_events_url":"https://api.github.com/users/Mailkov/received_events","type":"User","site_admin":false},"body":"IA Page: https://duck.co/ia/view/crypt_hash_check","created_at":"2015-12-28T15:57:45Z","updated_at":"2015-12-29T00:41:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b551d1bbbdab21b27298325b65e19471c3fe173e","assignee":{"login":"moollaza","id":873785,"avatar_url":"https://avatars.githubusercontent.com/u/873785?v=3","gravatar_id":"","url":"https://api.github.com/users/moollaza","html_url":"https://github.com/moollaza","followers_url":"https://api.github.com/users/moollaza/followers","following_url":"https://api.github.com/users/moollaza/following{/other_user}","gists_url":"https://api.github.com/users/moollaza/gists{/gist_id}","starred_url":"https://api.github.com/users/moollaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moollaza/subscriptions","organizations_url":"https://api.github.com/users/moollaza/orgs","repos_url":"https://api.github.com/users/moollaza/repos","events_url":"https://api.github.com/users/moollaza/events{/privacy}","received_events_url":"https://api.github.com/users/moollaza/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1978/comments","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/b06eb94152cad719677c49f7d8a1bd226888dffb","head":{"label":"Mailkov:crypthashcheckissue1163","ref":"crypthashcheckissue1163","sha":"b06eb94152cad719677c49f7d8a1bd226888dffb","user":{"login":"Mailkov","id":10259499,"avatar_url":"https://avatars.githubusercontent.com/u/10259499?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailkov","html_url":"https://github.com/Mailkov","followers_url":"https://api.github.com/users/Mailkov/followers","following_url":"https://api.github.com/users/Mailkov/following{/other_user}","gists_url":"https://api.github.com/users/Mailkov/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailkov/subscriptions","organizations_url":"https://api.github.com/users/Mailkov/orgs","repos_url":"https://api.github.com/users/Mailkov/repos","events_url":"https://api.github.com/users/Mailkov/events{/privacy}","received_events_url":"https://api.github.com/users/Mailkov/received_events","type":"User","site_admin":false},"repo":{"id":46127629,"name":"zeroclickinfo-goodies","full_name":"Mailkov/zeroclickinfo-goodies","owner":{"login":"Mailkov","id":10259499,"avatar_url":"https://avatars.githubusercontent.com/u/10259499?v=3","gravatar_id":"","url":"https://api.github.com/users/Mailkov","html_url":"https://github.com/Mailkov","followers_url":"https://api.github.com/users/Mailkov/followers","following_url":"https://api.github.com/users/Mailkov/following{/other_user}","gists_url":"https://api.github.com/users/Mailkov/gists{/gist_id}","starred_url":"https://api.github.com/users/Mailkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mailkov/subscriptions","organizations_url":"https://api.github.com/users/Mailkov/orgs","repos_url":"https://api.github.com/users/Mailkov/repos","events_url":"https://api.github.com/users/Mailkov/events{/privacy}","received_events_url":"https://api.github.com/users/Mailkov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mailkov/zeroclickinfo-goodies","description":"DuckDuckGo instant answer plugins based on Perl functions","fork":true,"url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies","forks_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/forks","keys_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/teams","hooks_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/hooks","issue_events_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/issues/events{/number}","events_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/events","assignees_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/assignees{/user}","branches_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/branches{/branch}","tags_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/tags","blobs_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/statuses/{sha}","languages_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/languages","stargazers_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/stargazers","contributors_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/contributors","subscribers_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/subscribers","subscription_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/subscription","commits_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/contents/{+path}","compare_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/merges","archive_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/downloads","issues_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/issues{/number}","pulls_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/pulls{/number}","milestones_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/milestones{/number}","notifications_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/labels{/name}","releases_url":"https://api.github.com/repos/Mailkov/zeroclickinfo-goodies/releases{/id}","created_at":"2015-11-13T14:48:41Z","updated_at":"2015-11-13T14:48:46Z","pushed_at":"2015-12-28T19:35:03Z","git_url":"git://github.com/Mailkov/zeroclickinfo-goodies.git","ssh_url":"git@github.com:Mailkov/zeroclickinfo-goodies.git","clone_url":"https://github.com/Mailkov/zeroclickinfo-goodies.git","svn_url":"https://github.com/Mailkov/zeroclickinfo-goodies","homepage":"http://duckduckhack.com/","size":11924,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"duckduckgo:master","ref":"master","sha":"5f2c130ff4dd8738f53680515d4232b4aef9b0f5","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":2164979,"name":"zeroclickinfo-goodies","full_name":"duckduckgo/zeroclickinfo-goodies","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/zeroclickinfo-goodies","description":"DuckDuckGo instant answer plugins based on Perl functions","fork":false,"url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies","forks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/forks","keys_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/teams","hooks_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/events","assignees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/tags","blobs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/subscription","commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/merges","archive_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/downloads","issues_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/releases{/id}","created_at":"2011-08-06T13:26:05Z","updated_at":"2015-12-28T12:14:47Z","pushed_at":"2015-12-28T23:22:33Z","git_url":"git://github.com/duckduckgo/zeroclickinfo-goodies.git","ssh_url":"git@github.com:duckduckgo/zeroclickinfo-goodies.git","clone_url":"https://github.com/duckduckgo/zeroclickinfo-goodies.git","svn_url":"https://github.com/duckduckgo/zeroclickinfo-goodies","homepage":"http://duckduckhack.com/","size":20167,"stargazers_count":367,"watchers_count":367,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1302,"mirror_url":null,"open_issues_count":191,"forks":1302,"open_issues":191,"watchers":367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978"},"html":{"href":"https://github.com/duckduckgo/zeroclickinfo-goodies/pull/1978"},"issue":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1978"},"comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/issues/1978/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/pulls/1978/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/zeroclickinfo-goodies/statuses/b06eb94152cad719677c49f7d8a1bd226888dffb"}}}}