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

TypeError: _reactNativeCryptoJs.default.HmacMD5.encrypt is not a function.

Open SalaSuresh-ITT opened this issue 4 years ago • 5 comments

Hi All, I'm using this package to generate HmacMD5 hash string in my application. with the below code in my function, I'm able to generate AES encrypted String.

import CryptoJS from "react-native-crypto-js";
...
function getHash() {
let ciphertext = CryptoJS.AES.encrypt('my message', 'secret key 123').toString();
  console.log("ciphertext: ", ciphertext);
  }
...

But when I replaced the AES with HmacMD5 in the above code, I'm ending up with the below error.

TypeError: _reactNativeCryptoJs.default.HmacMD5.encrypt is not a function. (In '_reactNativeCryptoJs.default.HmacMD5.encrypt('my message', 'secret key 123')', '_reactNativeCryptoJs.default.HmacMD5.encrypt' is undefined)

SalaSuresh-ITT avatar Jan 13 '21 05:01 SalaSuresh-ITT

I have the same issue

ashrafabbasov avatar Apr 27 '21 12:04 ashrafabbasov

Hi everyone, Does anyone please help here.

RahulPant1289 avatar Oct 20 '22 07:10 RahulPant1289

TypeError: _reactNativeCryptoJs.default.HmacSHA1 is not a function

packager : Pnpm react-native: 0.69.7 react: 18.0.0 "react-native-crypto-js": "^1.0.0",

CHANDRAMOHANnegi avatar Jan 10 '23 11:01 CHANDRAMOHANnegi