MD5/Implementation: Difference between revisions

Content added Content deleted
(Go solution)
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 n = Double.doubleToLongBits(d);
return (int)(long)((1L<<32) * d);
long exponent = (n >>> 52) & 0x7FF;
long fraction = (n & 0xFFFFFFFFFFFFFL) | 0x10000000000000L;
return (int)(fraction >>> (1043 - exponent));
}
}