{"action":"created","issue":{"url":"https://api.github.com/repos/brix/crypto-js/issues/32","labels_url":"https://api.github.com/repos/brix/crypto-js/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/brix/crypto-js/issues/32/comments","events_url":"https://api.github.com/repos/brix/crypto-js/issues/32/events","html_url":"https://github.com/brix/crypto-js/issues/32","id":95681870,"number":32,"title":"Undefined is not a function at hmac.js:58:18","user":{"login":"arikalfus","id":6969296,"avatar_url":"https://avatars.githubusercontent.com/u/6969296?v=3","gravatar_id":"","url":"https://api.github.com/users/arikalfus","html_url":"https://github.com/arikalfus","followers_url":"https://api.github.com/users/arikalfus/followers","following_url":"https://api.github.com/users/arikalfus/following{/other_user}","gists_url":"https://api.github.com/users/arikalfus/gists{/gist_id}","starred_url":"https://api.github.com/users/arikalfus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikalfus/subscriptions","organizations_url":"https://api.github.com/users/arikalfus/orgs","repos_url":"https://api.github.com/users/arikalfus/repos","events_url":"https://api.github.com/users/arikalfus/events{/privacy}","received_events_url":"https://api.github.com/users/arikalfus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-17T15:38:07Z","updated_at":"2015-08-04T11:38:40Z","closed_at":null,"body":"When calling Hmac functions in this library, I get the following stack trace:\r\n\r\n```\r\nTypeError: undefined is not a function\r\n  at Object.C_algo.HMAC.Base.extend.init (<path>/node_modules/crypto-js/hmac.js:58:18)\r\n  at Object.HmacSHA512 (<path>/node_modules/crypto-js/core.js:726:25)\r\n  <rest of stack trace is my app>\r\n```\r\n\r\nI tried `HmacSHA512` and `HmacSHA1`, using the example provided in the README. Both threw this error. At line 58 in hmac.js, the method 'clamp' is called on key: `key.clamp()`. It appears this is the undefined function referenced in the stack trace. I'm not sure what this should be replaced with. This is the relevant code in my application:\r\n```\r\nconst crypto = require('crypto-js');\r\nconst key = crypto.HmacSHA512(key, secret);\r\n```"},"comment":{"url":"https://api.github.com/repos/brix/crypto-js/issues/comments/127572279","html_url":"https://github.com/brix/crypto-js/issues/32#issuecomment-127572279","issue_url":"https://api.github.com/repos/brix/crypto-js/issues/32","id":127572279,"user":{"login":"brod","id":4452722,"avatar_url":"https://avatars.githubusercontent.com/u/4452722?v=3","gravatar_id":"","url":"https://api.github.com/users/brod","html_url":"https://github.com/brod","followers_url":"https://api.github.com/users/brod/followers","following_url":"https://api.github.com/users/brod/following{/other_user}","gists_url":"https://api.github.com/users/brod/gists{/gist_id}","starred_url":"https://api.github.com/users/brod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brod/subscriptions","organizations_url":"https://api.github.com/users/brod/orgs","repos_url":"https://api.github.com/users/brod/repos","events_url":"https://api.github.com/users/brod/events{/privacy}","received_events_url":"https://api.github.com/users/brod/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T11:38:40Z","updated_at":"2015-08-04T11:38:40Z","body":"    const crypto = require('crypto-js');\r\n    const key = crypto.HmacSHA512(\"Message\", \"Key\").toString();\r\n    console.log(key)\r\n\r\nOutputs\r\n\r\n     6b7c693d28c311b510c42bb30b07a61e9eb8d21918f257105fe65f1d82df6ac9c9abf0f282c20d646fc2f5015efbe473ac79afd67c756056f60a626afd58795d\r\n\r\nFor me, running `crypto-js 3.1.5`, `npm 2.9.1` & `node 0.12.3`.. \r\n\r\nafaik `clamp` is defined at `core.js:247 || crypto.js:247` and should not return undefined unless they are missing. Double check your install, sounds like a weird error."}}