MD5/Implementation Debug: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
 
Line 907:
{
for (int i = 0; i < 64; i++)
TABLE_T[i] = scaleToInt(int)(long)((1L << 32) * Math.abs(Math.sin(i + 1)));
}
private static int scaleToInt(double d)
{
// Converts IEEE-754 double from 0 to 1.0 to the range of an unsigned int
long n = Double.doubleToLongBits(d);
long exponent = (n >>> 52) & 0x7FF;
long fraction = (n & 0xFFFFFFFFFFFFFL) | 0x10000000000000L;
return (int)(fraction >>> (1043 - exponent));
}
Anonymous user