{"action":"opened","issue":{"url":"https://api.github.com/repos/digitalbazaar/forge/issues/300","labels_url":"https://api.github.com/repos/digitalbazaar/forge/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/digitalbazaar/forge/issues/300/comments","events_url":"https://api.github.com/repos/digitalbazaar/forge/issues/300/events","html_url":"https://github.com/digitalbazaar/forge/issues/300","id":108447726,"number":300,"title":"sha256 not working for national characters","user":{"login":"beastybeast","id":673959,"avatar_url":"https://avatars.githubusercontent.com/u/673959?v=3","gravatar_id":"","url":"https://api.github.com/users/beastybeast","html_url":"https://github.com/beastybeast","followers_url":"https://api.github.com/users/beastybeast/followers","following_url":"https://api.github.com/users/beastybeast/following{/other_user}","gists_url":"https://api.github.com/users/beastybeast/gists{/gist_id}","starred_url":"https://api.github.com/users/beastybeast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beastybeast/subscriptions","organizations_url":"https://api.github.com/users/beastybeast/orgs","repos_url":"https://api.github.com/users/beastybeast/repos","events_url":"https://api.github.com/users/beastybeast/events{/privacy}","received_events_url":"https://api.github.com/users/beastybeast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-26T08:00:34Z","updated_at":"2015-09-26T08:00:34Z","closed_at":null,"body":"Hi\r\n\r\nThe example for sha256 does not work with for example Danish characters as 'æøå'\r\n\r\nfunction sha256(text)\r\n{\r\n\tvar md = forge.md.sha256.create();\r\n\tmd.update(text);\r\n\treturn md.digest().toHex();\r\n}\r\n\r\nIt produce the wrong hash compared to online sources and the PHP hash function.\r\n\r\nThis may be related to some UTF-8 issues as\r\n\r\nfunction sha256(text)\r\n{\r\n\tvar md = forge.md.sha256.create();\r\n\tmd.update(forge.util.encodeUtf8(text));\r\n\treturn md.digest().toHex();\r\n}\r\n\r\nWorks fine!\r\n\r\nJust think that this is relevant for a lot of people ;-)"}}