Base hashing in Python.