react-native-crypto-js icon indicating copy to clipboard operation
react-native-crypto-js copied to clipboard

_reactNativeCryptoJS.default.HmacSHA256() is not a function

Open MrQureshi opened this issue 5 years ago • 6 comments

package define this HmacSHA256 function in Documentation but it return this error _reactNativeCryptoJS.default.HmacSHA256() is not a function

MrQureshi avatar Feb 07 '20 13:02 MrQureshi

I am having this same issue - looks like its not a supported algo? Which makes this not a very good port of CryptoJS

image

mzupek avatar Mar 18 '20 16:03 mzupek

@mzupek I have found solution for this issue in react-native import like this const Crypto = require('crypto-js'); and use like this, Crypto.HmacSHA256(prependedPayload, _SALT);

MrQureshi avatar Mar 18 '20 16:03 MrQureshi

@MrQureshi I keep getting a haste map cannot resolve module crypto-js error? did you run into this?

image

I tried all of the suggested remedies?

mzupek avatar Mar 19 '20 20:03 mzupek

@mzupek remove your node_module and install again remove that line where you import you Crypto-js replce with const Crypto = require('crypto-js');

MrQureshi avatar Mar 21 '20 09:03 MrQureshi

@MrQureshi -- you can't use crypto-js --- it says core.js crypto not found when using HmacSHA256

ortonomy avatar Jul 17 '20 12:07 ortonomy

Still having this issue, any workarounds ?

anis-18 avatar Dec 28 '22 05:12 anis-18