forked from I2P_Developers/i2p.i2p
2006-04-14 jrandom
* -28.00230115311259 is not between 0 and 1 in any universe I know. * Made the bw-related tunnel join throttle much simpler
This commit is contained in:
@@ -157,11 +157,12 @@ public class FortunaRandomSource extends RandomSource implements EntropyHarveste
|
||||
* through 2^numBits-1
|
||||
*/
|
||||
protected synchronized int nextBits(int numBits) {
|
||||
int rv = 0;
|
||||
long rv = 0;
|
||||
int bytes = (numBits + 7) / 8;
|
||||
for (int i = 0; i < bytes; i++)
|
||||
rv += ((_fortuna.nextByte() & 0xFF) << i*8);
|
||||
return rv;
|
||||
rv >>>= (64-numBits);
|
||||
return (int)rv;
|
||||
}
|
||||
|
||||
public EntropyHarvester harvester() { return this; }
|
||||
|
Reference in New Issue
Block a user