MD5/Implementation: Difference between revisions
Content deleted Content added
Go solution |
→{{header|Java}}: simpler |
||
Line 1,311: | Line 1,311: | ||
{ |
{ |
||
// Converts IEEE-754 double from 0 to 1.0 to the range of an unsigned int |
// Converts IEEE-754 double from 0 to 1.0 to the range of an unsigned int |
||
long |
return (int)(long)((1L<<32) * d); |
||
long exponent = (n >>> 52) & 0x7FF; |
|||
long fraction = (n & 0xFFFFFFFFFFFFFL) | 0x10000000000000L; |
|||
return (int)(fraction >>> (1043 - exponent)); |
|||
} |
} |
||