custom hasing in python using linear probing