A Python implementation of SipHash.
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
siphash.py

README.md

siphash-python

A Python implementation of SipHash.

The source code is under MIT license.

Usage

Import as a class:

>>> from siphash import SipHash
>>> my_hash = SipHash()

Or use specific c and d:

>>> my_hash = SipHash(c=2, d=4)

Use a 128-bit key to authenticate a string:

>>> k = 0x0f0e0d0c0b0a09080706050403020100
>>> m = 'A short message'
>>> t = my_hash.auth(k, m)
>>> hex(t)
'0xae43dfaed1ab1c00L'