Registry / serialization / siphash

siphash

JSON →
library0.0.1pypypi✓ verified 84d ago

A pure Python implementation of SipHash, a fast short-input PRF. Version 0.0.1 is the latest and only release; no active development.

pip install siphash
INSTALL
IMPORT
SIG · SIPHASH
S
siphash
serializationpythonv0.0.1
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SipHash_2_4
from siphash import SipHash_2_4
Correct, though SipHash_2_4 is a class; there is also SipHash_1_3.

Setup key and message, then call instance to get 64-bit hash.

from siphash import SipHash_2_4 key = b'\x00' * 16 # 128-bit key msg = b'hello' siphash = SipHash_2_4(key) digest = siphash(msg) print(digest.hex()) # 64-bit digest
Debug
Known issues
gotchaKey must be exactly 16 bytes; any other length raises ValueError.
fix
Ensure key length is 16.
affects: 0.0.1
gotchaSipHash_2_4 and SipHash_1_3 are the only variants; no 8-round or 4-round versions.
fix
Use SipHash_2_4 for default security.
affects: 0.0.1
gotchaInput message must be bytes; passing str will cause TypeError.
fix
Encode strings before hashing: msg.encode('utf-8')
affects: 0.0.1
Errors
Common errors & fixes
TypeError: a bytes-like object is required, not 'str'
Message passed as string instead of bytes.
fix
Use msg = 'hello'.encode('utf-8')
ValueError: Key must be exactly 16 bytes long
Key length is not 16 bytes.
fix
Ensure key is 16 bytes: key = b'sixteenbyteslong'
Upgrade
Version history
0.0.1latest on PyPI · released Jan 22, 2013
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
siphash — pip install siphash · libregistry