hkkr123 / crypto-js

Automatically exported from code.google.com/p/crypto-js
0 stars 0 forks source link

CryptoJS.MD5 produces a different result in IE11 compared to Chrome & everyone else #121

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.parseInt(CryptoJS.MD5('CREDIT CABLE'), 16).toString(); in IE11
2. Ditto in Chrome or OPera or Firefox or Safari
3.

What is the expected output? 

Identical results:

What do you see instead?
 In IE11, I see:

"3934330116379802"

In every other other browser I see:

"3934330116379803"

What version of the product are you using? 

IE11 is version 11.0.9600.16518
Chrome: 33.0.1750.146 m

On what operating system?

Windows 8.1 

Please provide any additional information below.

Ask me if you need more info. The attachment shows a game where I wanted a 
reproducible random number seed.

Original issue reported on code.google.com by PatJDoo...@gmail.com on 24 Mar 2014 at 4:17

GoogleCodeExporter commented 8 years ago

Original comment by PatJDoo...@gmail.com on 24 Mar 2014 at 4:18

GoogleCodeExporter commented 8 years ago
This is apparently a difference in behavior between browsers that has nothing 
to do with CryptoJS.

parseInt('FF4B247BC9C50193E1C8074003D1C3D0', 16)

You're trying to get a 64-bit number from a 128-bit value, and apparently the 
browsers do that slightly differently.

Original comment by Jeff.Mott.OR on 24 Mar 2014 at 1:36

GoogleCodeExporter commented 8 years ago

Original comment by Jeff.Mott.OR on 25 Mar 2014 at 3:33

GoogleCodeExporter commented 8 years ago
I've researched the issue. Not CryptoJS. IE arithmetic with very long numbers 
is different from other browsers. It is less accurate in the last digit of 
precision. 

Original comment by PatJDoo...@gmail.com on 25 Mar 2014 at 3:53