{ "info": { "author": "Marek Majkowski", "author_email": "marek@popcount.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "pysiphash\n====\n\nA Python implementation of [SipHash](https://131002.net/siphash/), a\nfast short-input PRF.\n\nExtract from the description:\n\n```\nSipHash is a family of pseudorandom functions (a.k.a. keyed hash\nfunctions) optimized for speed on short messages.\n\nTarget applications include network traffic authentication and defense\nagainst hash-flooding DoS attacks.\n\nSipHash is secure, fast, and simple (for real):\n* SipHash is simpler and faster than previous cryptographic algorithms\n (e.g. MACs based on universal hashing)\n* SipHash is competitive in performance with insecure\n non-cryptographic algorithms (e.g. MurmurHash)\n* We propose that hash tables switch to SipHash as a hash\n function. Users of SipHash already include OpenDNS, Perl 5, Ruby, or\n Rust.\n```\n\nusage\n----\n\n`Pysiphash` tries to follow the\n[hashlib](http://docs.python.org/2/library/hashlib.html) API. You can\nadd data to the hash by calling an `update` method, or feed data\ndirectly to the constructor:\n\n```:python\n>>> import siphash\n>>> key = '0123456789ABCDEF'\n>>> sip = siphash.SipHash_2_4(key)\n>>> sip.update('a')\n>>> sip.hash()\n12398370950267227270L\n\n>>> siphash.SipHash_2_4(key, 'a').hash()\n12398370950267227270L\n```\n\nTo extract the hash as a numeric value call `hash()`:\n\n```\n>>> siphash.SipHash_2_4(key, 'a').hash()\n12398370950267227270L\n```\n\nOr `digest()` to get a raw 8-bytes string:\n```:python\n>>> siphash.SipHash_2_4(key, 'a').digest()\n'\\x86L3\\x9c\\xb0\\xdc\\x0f\\xac'\n```\n\nOr `hexdigest()` for a 16-bytes hex encoding:\n```:python\n>>> siphash.SipHash_2_4(key, 'a').hexdigest()\n'864c339cb0dc0fac'\n```\n\ntesting\n----\n\nA series of sanity checks are present inline the main `pysiphash`\ncode, to run it type:\n\n```:bash\n$ python siphash/__init__.py\nall tests ok\n```\n\nspeed\n----\n\nCurrently `pysiphash` is a pure-python code, so don't expect blazing\nspeed. On my machine computing a hash from a ten byte string takes\naround 0.31 ms, and hashing 1MiB blob takes 770 ms.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/majek/pysiphash#readme", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "siphash", "package_url": "https://pypi.org/project/siphash/", "platform": "any", "project_url": "https://pypi.org/project/siphash/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/majek/pysiphash#readme" }, "release_url": "https://pypi.org/project/siphash/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "siphash - python siphash implementation", "version": "0.0.1" }, "last_serial": 799616, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "09b9964ee3b0aff3f7a15b157473f4e7", "sha256": "aee97fe95e09a2995819c058a5e4ac6d96661a898d7fe0ad55e3b72c9a31d461" }, "downloads": -1, "filename": "siphash-0.0.1.tar.gz", "has_sig": false, "md5_digest": "09b9964ee3b0aff3f7a15b157473f4e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5917, "upload_time": "2013-01-22T14:15:02", "url": "https://files.pythonhosted.org/packages/8a/ff/203e8bf26c5658f4df97a966c32f21dd9125d740e7c92795ca1055b45772/siphash-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09b9964ee3b0aff3f7a15b157473f4e7", "sha256": "aee97fe95e09a2995819c058a5e4ac6d96661a898d7fe0ad55e3b72c9a31d461" }, "downloads": -1, "filename": "siphash-0.0.1.tar.gz", "has_sig": false, "md5_digest": "09b9964ee3b0aff3f7a15b157473f4e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5917, "upload_time": "2013-01-22T14:15:02", "url": "https://files.pythonhosted.org/packages/8a/ff/203e8bf26c5658f4df97a966c32f21dd9125d740e7c92795ca1055b45772/siphash-0.0.1.tar.gz" } ] }