CryptoJS MD5 outputs wrong hash after publish

Hello! Running Expo straight from the DevTools via Wi-Fi in the Expo app CryptoJS (react-native-crypto-js) MD5 function produces correct MD5 hash. But after publishing the app, the MD5 hash is wrong.

Simply running:

Alert.alert(‘MD5 Check’, CryptoJS.MD5(‘test’).toString(), [{text: ‘Ok’}]);

Produces the wrong hash. What does publish do so that the MD5 function behaves differently?

Could you provide a sample Snack that I can use to reproduce this? What do you mean by “Wrong hash”?

Also- you could try using Expo’s Crypto module and see if that has the same behavior

Sorry i’m not familiar with Snacks but by simply importing CryptoJS and creating a simple MD5 digest, it differs from other digests created by other MD5 functions from other enviroments (like PHP). I switched from CryptoJS to Expo’s Crypto and it works as expected (digest is the same in DevTools and published app).

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.