fixed a bug in randHash... it was potentially returning an invalid number

This commit is contained in:
Jason Persampieri 2004-12-09 03:50:43 +00:00
parent be91051e40
commit cf620b6396

View File

@ -10,7 +10,7 @@ def randHash(num):
bit patterns (i.e. doIds or zoneIds) to numbers with random bit patterns bit patterns (i.e. doIds or zoneIds) to numbers with random bit patterns
""" """
rng = RandomNumGen(num) rng = RandomNumGen(num)
return rng.randint(0,1<<16) return rng.randint(0, (1<<16) - 1)
class RandomNumGen: class RandomNumGen:
notify = \ notify = \