Skip to main content

No project description provided

Project description

This library provides a deterministic hash for Python objects. hash will give different results each process invocation, in order to thwart denial-of-service attacks based on intentionally triggering hash collisions (see -R in Python’s CLI options). Even setting PYTHONHASHSEED is not enough, because the hash can still use non-deterministic data such as pointer-addresses. By default, this package uses the xxhash algorithm, which is the fastest non-cryptographic hash I know of.

>>> from charmonium.determ_hash import determ_hash
>>> determ_hash(b"hello world")
141361478936837800319111455324245712876

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charmonium.determ_hash-0.2.2.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

charmonium.determ_hash-0.2.2-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page