do a hash lookup for collision detection

hash lookup should be faster than searching an array.