{"action":"created","issue":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/375","labels_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/375/labels{/name}","comments_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/375/comments","events_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/375/events","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/375","id":93907265,"number":375,"title":"Add an hs.hash module?","user":{"login":"cmsj","id":353427,"avatar_url":"https://avatars.githubusercontent.com/u/353427?v=3","gravatar_id":"","url":"https://api.github.com/users/cmsj","html_url":"https://github.com/cmsj","followers_url":"https://api.github.com/users/cmsj/followers","following_url":"https://api.github.com/users/cmsj/following{/other_user}","gists_url":"https://api.github.com/users/cmsj/gists{/gist_id}","starred_url":"https://api.github.com/users/cmsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmsj/subscriptions","organizations_url":"https://api.github.com/users/cmsj/orgs","repos_url":"https://api.github.com/users/cmsj/repos","events_url":"https://api.github.com/users/cmsj/events{/privacy}","received_events_url":"https://api.github.com/users/cmsj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/labels/extension%20suggestion","name":"extension suggestion","color":"5319e7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-08T22:46:15Z","updated_at":"2015-07-13T16:36:19Z","closed_at":"2015-07-13T15:12:25Z","body":"I've already used an md5 library once. How about we add hs.hash that can do md5 and sha hashing? They seem like fundamental things people will want to do, even though it's relatively trivial to download an existing library to ~/.hammerspoon/\r\n\r\nWhat do people think?"},"comment":{"url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/comments/120988566","html_url":"https://github.com/Hammerspoon/hammerspoon/issues/375#issuecomment-120988566","issue_url":"https://api.github.com/repos/Hammerspoon/hammerspoon/issues/375","id":120988566,"user":{"login":"cmsj","id":353427,"avatar_url":"https://avatars.githubusercontent.com/u/353427?v=3","gravatar_id":"","url":"https://api.github.com/users/cmsj","html_url":"https://github.com/cmsj","followers_url":"https://api.github.com/users/cmsj/followers","following_url":"https://api.github.com/users/cmsj/following{/other_user}","gists_url":"https://api.github.com/users/cmsj/gists{/gist_id}","starred_url":"https://api.github.com/users/cmsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmsj/subscriptions","organizations_url":"https://api.github.com/users/cmsj/orgs","repos_url":"https://api.github.com/users/cmsj/repos","events_url":"https://api.github.com/users/cmsj/events{/privacy}","received_events_url":"https://api.github.com/users/cmsj/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T16:36:19Z","updated_at":"2015-07-13T16:36:19Z","body":"@jhgg Added HMAC variants :)\r\n\r\nFor future reference, I've verified all of the hs.hash functions with this code:\r\n\r\n    assert(hs.hash.SHA1(\"lol\") == \"403926033d001b5279df37cbbe5287b7c7c267fa\")\r\n    assert(hs.hash.SHA512(\"lol\") == \"3dd28c5a23f780659d83dd99981e2dcb82bd4c4bdc8d97a7da50ae84c7a7229a6dc0ae8ae4748640a4cc07ccc2d55dbdc023a99b3ef72bc6ce49e30b84253dae\")\r\n    assert(hs.hash.SHA256(\"lol\") == \"07123e1f482356c415f684407a3b8723e10b2cbbc0b8fcd6282c49d37c9c1abc\")\r\n    assert(hs.hash.MD5(\"lol\") == \"9cdfb439c7876e703e307864c9167a15\")\r\n\r\n    assert(hs.hash.hmacSHA1(\"lolkey\", \"lol\") == \"2cb3d65f0cf92b733b5aa770210159e5634db459\")\r\n    assert(hs.hash.hmacSHA256(\"lolkey\", \"lol\") == \"01ec251a14db459d818f9e42c6edd36fa5fe293964e5e53d3155fb8357b80ea4\")\r\n    assert(hs.hash.hmacSHA512(\"lolkey\", \"lol\") == \"6b650ff1a2cea96e8e6a8035c68cea4d1f8b0d334768b26fdfc7dfc38b634e6af431c095616c5c336c33a591a506ad6cdcaf6acd4237b78ba7ee38cfaf058ed9\")\r\n    assert(hs.hash.hmacMD5(\"lolkey\", \"lol\") == \"4af8dd5b3f65c84edac76700111f22d1\")\r\n\r\n(The values there were calculated with either md5(1)/shasum(1) or `openssl dgst -{sha{1,256,512}, md5} -hmac)"}}