Skip to main content

spooky

SpookyHash V2 is a fast x64 targeted hash developed by Bob Jenkins. This python library is a wrapper around Bob Jenkin’s public domain c++ implementation (current as of August 2012).

In python2 results are all long type for consistency despite the fact that 32bit ints do not need to be.

The bit width features are a convenience to save a masking operation if you need shorter hashes. There isn’t a significant performance difference between the hash size options as they are all computed internally as 128bit hashes.

Usage

>>> from spooky import hash128, hash64, hash32
>>> s = 'this is only a test...'
>>> hash128(s) #128bit python int from 2 unsigned long long ints in c
94655121727368234505791352840874203973
>>> hash64(s) #64bit int
13961228348271205189
>>> hash32(s) #32bit int
2261883717
>>> hash32(s) == hash64(s) & 0xffffffff == hash128(s) & 0xffffffff
True
>>> from binascii import hexlify #if you prefer hex strings to ints
>>> hexlify(hash128(s).to_bytes(16, 'little'))
b'459bd186363fc0c1f1da8d27d0e93547'

Metadata

Release files for spooky 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spooky 2.0.0
File Size Uploaded Provenance Actions
spooky-2.0.0.tar.gz 8.2 kB Without provenance Details for spooky-2.0.0.tar.gz

Release files / spooky-2.0.0.tar.gz

Download URL spooky-2.0.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9d9ce6f52d57d63d136d87d834cc81e8f4cd65d1f2ca1f5b2e35eee5c5f048f7
BLAKE2b-256 checksum
How to use checksums
c51c56e3589d67e25b76bdc8937585fd4112c9d4a04eff120723111631c5ca36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for spooky 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page