Friedrich Ewald My Personal Website

Predictable hash function

The hash method in python produces different results for the same object on each different Python run. This is meant as a security feature to prevent predictable hash values. For testing, this can be disabled by setting the environment variable PYTHONHASHSEED to 0. The hash value for a given key will then always be the same.

PYTHONHASHSEED=0 python script.py


About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.