Skip to content

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

@SalaSuresh-ITT

Description

@SalaSuresh-ITT

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions