{"id":24593,"library":"siphash","title":"SipHash","description":"A pure Python implementation of SipHash, a fast short-input PRF. Version 0.0.1 is the latest and only release; no active development.","status":"active","version":"0.0.1","language":"python","source_language":"en","source_url":"http://github.com/majek/pysiphash","tags":["siphash","hash","PRF"],"install":[{"cmd":"pip install siphash","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Correct, though SipHash_2_4 is a class; there is also SipHash_1_3.","symbol":"SipHash_2_4","correct":"from siphash import SipHash_2_4"}],"quickstart":{"code":"from siphash import SipHash_2_4\n\nkey = b'\\x00' * 16  # 128-bit key\nmsg = b'hello'\n\nsiphash = SipHash_2_4(key)\ndigest = siphash(msg)\nprint(digest.hex())  # 64-bit digest","lang":"python","description":"Setup key and message, then call instance to get 64-bit hash."},"warnings":[{"fix":"Ensure key length is 16.","message":"Key must be exactly 16 bytes; any other length raises ValueError.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Use SipHash_2_4 for default security.","message":"SipHash_2_4 and SipHash_1_3 are the only variants; no 8-round or 4-round versions.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Encode strings before hashing: msg.encode('utf-8')","message":"Input message must be bytes; passing str will cause TypeError.","severity":"gotcha","affected_versions":"0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use msg = 'hello'.encode('utf-8')","cause":"Message passed as string instead of bytes.","error":"TypeError: a bytes-like object is required, not 'str'"},{"fix":"Ensure key is 16 bytes: key = b'sixteenbyteslong'","cause":"Key length is not 16 bytes.","error":"ValueError: Key must be exactly 16 bytes long"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}