Hashing Function In Python