javascript - CryptoJS MD5 not converting word array, SHA256 works fine -


I am using CryptoJS library for Javascript MD5 and SHA256 hashing:

SHA256 luggage work Is doing fine, but I can not convert the MD5 hash result back into the string from a word array. Below is the problem that I am just using to reduce the problem - I have reduced the actual hash result, and console.log () is added as comments in comments < / P>

  email_hash = $ rootScope.Session.email.toLowerCase (); Console.log ('email', email_hash); // email email@example.com sha_hash = CryptoJS.SHA256 (email_hash) .toString (cryptoos.ac.hex); Console.log ('sha', sha_hash); // SHA SHA256-VALUE-OUTPUTS-Fine email_hash = CryptoJS.MD5 (email_hash); Console.log (JSON.stringify (email_hash)); // {"word": [0000000000, -0000000000, -00000000000, 0000000000], "sigBytes": 16} a = email_hash.toString (CryptoJS.enc.Latin1); B = email_hash.toString (cryptoos.ac.hex); Console.log (A, B); // [object object] [object object]  

What am I doing in the result of MD5?

Oh ok - the answer I have posted in which code.

I was using version 3.1.2 for version 3.0.2 and MD5 of SHA256 code. SHA256 is updating to 3.1.2, so both of them are on the same version, have fixed it. I am adding SHA256 to MD5, so this may have been written in the MD5 file.


Comments