{ "info": { "author": "Hajime Senuma", "author_email": "hajime.senuma@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "mmh3\n====\n\n.. image:: https://img.shields.io/travis/hajimes/mmh3.svg?branch=master\n :target: https://travis-ci.org/hajimes/mmh3\n\n.. image:: https://ci.appveyor.com/api/projects/status/github/hajimes/mmh3?branch=master&svg=true\n :target: https://ci.appveyor.com/project/hajimes/mmh3\n\nPython wrapper for MurmurHash (MurmurHash3), a set of fast and robust hash functions.\n\nmmh3 2.5.1 supports Python 2.7, Python 3.3 and higher.\n\nUsage\n-----\n\nSample Usage::\n\n >>> import mmh3\n >>> mmh3.hash('foo') # 32 bit signed int\n -156908512\n >>> mmh3.hash('foo', 42) # uses 42 for its seed\n -1322301282\n >>> mmh3.hash('foo', signed=False) # 32 bit unsigned int (since Version 2.5)\n 4138058784\n\nOther functions::\n\n >>> mmh3.hash64('foo') # two 64 bit signed ints (by using the 128-bit algorithm as its backend)\n (-2129773440516405919, 9128664383759220103)\n >>> mmh3.hash64('foo',signed =False) # two 64 bit unsigned ints\n (16316970633193145697, 9128664383759220103)\n >>> mmh3.hash128('foo', 42) # 128 bit unsigned int\n 215966891540331383248189432718888555506\n >>> mmh3.hash128('foo', 42, signed = True) # 128 bit signed int\n -124315475380607080215185174712879655950\n >>> mmh3.hash_bytes('foo') # 128 bit value as bytes\n 'aE\\xf5\\x01W\\x86q\\xe2\\x87}\\xba+\\xe4\\x87\\xaf~'\n\n``hash64``, ``hash128``, and ``hash_bytes`` have the third argument for architecture optimization. Use True for x64 and False for x86 (default: True).::\n\n >>> mmh3.hash64('foo', 42, True) \n (-840311307571801102, -6739155424061121879)\n\nVersion 2.5 added ``hash_from_buffer``, which hashes byte-likes without memory copying. The method is suitable when you hash a large memory-view such as ``numpy.ndarray``.\n\n >>> mmh3.hash_from_buffer(numpy.random.rand(100))\n -2137204694\n >>> mmh3.hash_from_buffer(numpy.random.rand(100), signed = False)\n 3812874078\n\nBeware that ``hash64`` returns **two** values, because it uses the 128-bit version of MurmurHash3 as its backend.\n\nVersion 2.4 added support for 64-bit data.\n\n >>> import numpy as np\n >>> a = np.zeros(2**32, dtype=np.int8)\n >>> mmh3.hash_bytes(a)\n b'V\\x8f}\\xad\\x8eNM\\xa84\\x07FU\\x9c\\xc4\\xcc\\x8e'\n\nVersion 2.4 also changed the type of seeds from signed 32-bit int to unsigned 32-bit int. (**The resulting values with signed seeds still remain the same as before, as long as they are 32-bit**)\n\n >>> mmh3.hash('aaaa', -1756908916) # signed rep. for 0x9747b28c\n 1519878282\n >>> mmh3.hash('aaaa', 2538058380) # unsigned rep. for 0x9747b28c\n 1519878282\n\nBe careful so that these seeds do not exceed 32-bit. Unexpected results may happen with invalid values.\n\n >>> mmh3.hash('foo', 2 ** 33)\n -156908512\n >>> mmh3.hash('foo', 2 ** 34)\n -156908512\n\n\nChanges\n=======\n2.5.1 (2017-10-31)\n------------------\n* Bug fix for ``hash_bytes``. Thanks `doozr `_!\n\n2.5 (2017-10-28)\n------------------\n* Add ``hash_from_buffer``. Thanks `Dimitri Vorona `_!\n* Add a keyword argument ``signed``.\n\n2.4 (2017-05-27)\n------------------\n* Support seeds with 32-bit unsigned integers; thanks `Alexander Maznev `_!\n* Support 64-bit data (under 64-bit environments)\n* Fix compile errors for Python 3.6 under Windows systems.\n* Add unit testing and continuous integration with Travis CI and AppVeyor.\n\n2.3.2 (2017-05-26)\n------------------\n* Relicensed from public domain to `CC0-1.0 <./LICENSE>`_.\n\n2.3.1 (2015-06-07)\n------------------\n* Fix compile errors for gcc >=5.\n\n2.3 (2013-12-08)\n----------------\n* Add ``hash128``, which returns a 128-bit signed integer.\n* Fix a misplaced operator which could cause memory leak in a rare condition.\n* Fix a malformed value to a Python/C API function which may cause runtime errors in recent Python 3.x versions.\n\nThe first two commits are from `Derek Wilson `_. Thanks!\n\n2.2 (2013-03-03)\n----------------\n* Improve portability to support systems with old gcc (version < 4.4) such as CentOS/RHEL 5.x. (Commit from `Micha Gorelick `_. Thanks!)\n\n2.1 (2013-02-25)\n----------------\n\n* Add `__version__` constant. Check if it exists when the following revision matters for your application.\n* Incorporate the revision r147, which includes robustness improvement and minor tweaks.\n\nBeware that due to this revision, **the result of 32-bit version of 2.1 is NOT the same as that of 2.0**. E.g.,::\n\n >>> mmh3.hash('foo') # in mmh3 2.0\n -292180858\n >>> mmh3.hash('foo') # in mmh3 2.1\n -156908512\n\nThe results of hash64 and hash_bytes remain unchanged. Austin Appleby, the author of Murmurhash, ensured this revision was the final modification to MurmurHash3's results and any future changes would be to improve performance only.\n\nLicense\n=======\n\n`CC0-1.0 <./LICENSE>`_.\n\nFAQ\n===\n\nHow can I use this module? Any tutorials?\n-----------------------------------------\n\nThe following textbooks and tutorials are great sources to learn how to use mmh3 (and other hash algorithms in general) for high-performance computing.\n\n* Chapter 11: Using Less Ram in Micha Gorelick and Ian Ozsvald. 2014. *High Performance Python: Practical Performant Programming for Humans*. O'Reilly Media. `ISBN: 978-1-4493-6159-4 `_.\n* Duke University. `Efficient storage of data in memeory `_.\n* Max Burstein. `Creating a Simple Bloom Filter `_.\n* Bugra Akyildiz. `A Gentle Introduction to Bloom Filter `_.\n\nSome results are different from other MurmurHash3-based libraries.\n------------------------------------------------------------------\n\nBy default, mmh3 returns **signed** values for 32-bit and 64-bit versions and **unsigned** values for ```hash128```, due to historical reasons. Please use the keyword argument ``signed`` to obtain a desired result.\n\nFor compatibility with Google Guava (Java), see https://stackoverflow.com/questions/29932956/murmur3-hash-different-result-between-python-and-java-implementation\n\n\nI want to report errors/ask questions/send requests.\n----------------------------------------------------\n\nThank you for helping me to improve the library. Please make sure to post them *through the issue tracking system of GitHub*. Issues sent directly to my email account may go unnoticed.\n\nAuthors\n=======\n\nMurmurHash3 was originally developed by Austin Appleby and distributed under public domain.\n\n* http://code.google.com/p/smhasher/\n\nPorted and modified for Python by Hajime Senuma.\n\n* http://pypi.python.org/pypi/mmh3\n* http://github.com/hajimes/mmh3\n\nSee also\n========\n\n* https://github.com/wc-duck/pymmh3: mmh3 in pure python (Fredrik Kihlander and Swapnil Gusani)\n* https://github.com/escherba/python-cityhash: Python bindings for CityHash (Eugene Scherba)\n* https://github.com/veelion/python-farmhash: Python bindigs for FarmHash (Veelion Chong)\n* https://github.com/escherba/python-metrohash: Python bindings for MetroHash (Eugene Scherba)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://packages.python.org/mmh3", "keywords": "utility hash MurmurHash", "license": "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "maintainer": "", "maintainer_email": "", "name": "mmh3", "package_url": "https://pypi.org/project/mmh3/", "platform": "", "project_url": "https://pypi.org/project/mmh3/", "project_urls": { "Homepage": "http://packages.python.org/mmh3" }, "release_url": "https://pypi.org/project/mmh3/2.5.1/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for MurmurHash (MurmurHash3), a set of fast and robust hash functions.", "version": "2.5.1" }, "last_serial": 3294310, "releases": { "2.0": [ { "comment_text": "", "digests": { "md5": "801e9d44f8bd24ae663f201c53918fb5", "sha256": "787f67a05a9cf9a5ac0b4755e0b0cc2ded5a1541ffde710da43aeebd7a15162b" }, "downloads": -1, "filename": "mmh3-2.0.tar.gz", "has_sig": false, "md5_digest": "801e9d44f8bd24ae663f201c53918fb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4863, "upload_time": "2011-06-07T14:17:38", "url": "https://files.pythonhosted.org/packages/cb/e0/d9459f9d4b56cc78c85f1c1aca54eb0ed89d4ed703da979e09b24806d434/mmh3-2.0.tar.gz" } ], "2.2": [ { "comment_text": "", "digests": { "md5": "de69924d56b7838e818de246591cdb8b", "sha256": "1c4f2cc8c15e473ec1e30f88619559a653a3068812a5108597ea9ec21a971d71" }, "downloads": -1, "filename": "mmh3-2.2.tar.gz", "has_sig": false, "md5_digest": "de69924d56b7838e818de246591cdb8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5526, "upload_time": "2013-03-03T12:49:32", "url": "https://files.pythonhosted.org/packages/55/54/7130149630120d8ab7c6b395966e908dc9f54e769982e34135db6713846c/mmh3-2.2.tar.gz" } ], "2.3": [ { "comment_text": "", "digests": { "md5": "1e1e7acc8a4a5714ddc0f9228ebfb5b3", "sha256": "ef9896a8083ffadf92a9e41e3db4d276670cdcddf4b2a4d619d92edb4af6cbdb" }, "downloads": -1, "filename": "mmh3-2.3.tar.gz", "has_sig": false, "md5_digest": "1e1e7acc8a4a5714ddc0f9228ebfb5b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5964, "upload_time": "2013-12-10T14:29:14", "url": "https://files.pythonhosted.org/packages/e9/a3/eca10f533c29f24610432c6e379c1196ce7c21990392d94d07551cb06cda/mmh3-2.3.tar.gz" } ], "2.3.1": [ { "comment_text": "", "digests": { "md5": "388380bfd5f8f702ba2af7e4d72bddee", "sha256": "ecadc3557c093211a70b49814cf91d6833fff403edf2d8405645e227262de928" }, "downloads": -1, "filename": "mmh3-2.3.1.tar.gz", "has_sig": false, "md5_digest": "388380bfd5f8f702ba2af7e4d72bddee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6122, "upload_time": "2015-06-07T23:03:12", "url": "https://files.pythonhosted.org/packages/87/a9/d15efdb230b1588b9427c77ce4b608aaf478bd0ebd47b2f6a7a1bc7cce4b/mmh3-2.3.1.tar.gz" } ], "2.4": [ { "comment_text": "", "digests": { "md5": "86bb3f4cd0ce4a934d0216348586249b", "sha256": "d8c2e813cc29aca93d8d5f89a497efbb37e61db21a43133651d4833d7b50962f" }, "downloads": -1, "filename": "mmh3-2.4.tar.gz", "has_sig": false, "md5_digest": "86bb3f4cd0ce4a934d0216348586249b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8130, "upload_time": "2017-05-29T15:06:03", "url": "https://files.pythonhosted.org/packages/c7/9f/4e97cfdeb5aa486531d804e8eafb42822a9d036ab86849a21603ad098dbb/mmh3-2.4.tar.gz" } ], "2.5": [ { "comment_text": "", "digests": { "md5": "2648b0b3e504f9729d373555d76813ba", "sha256": "b9c6354d851ee2173febc5125b6953c092de719f7dd24d38bacecb2fb6e81f52" }, "downloads": -1, "filename": "mmh3-2.5.tar.gz", "has_sig": false, "md5_digest": "2648b0b3e504f9729d373555d76813ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9733, "upload_time": "2017-10-28T15:01:06", "url": "https://files.pythonhosted.org/packages/04/6b/bcb464ef80d5a28d6195c9df09139c80e59f347c32b1ae50742f87e231da/mmh3-2.5.tar.gz" } ], "2.5.1": [ { "comment_text": "", "digests": { "md5": "4ca766a84a782f57dd0e213182a3c1da", "sha256": "185209a217c52afe43e079e5b232d0ef0f3a262601eaaf4371326ab6dcbec508" }, "downloads": -1, "filename": "mmh3-2.5.1.tar.gz", "has_sig": false, "md5_digest": "4ca766a84a782f57dd0e213182a3c1da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9797, "upload_time": "2017-10-31T13:44:56", "url": "https://files.pythonhosted.org/packages/fa/7e/3ddcab0a9fcea034212c02eb411433db9330e34d626360b97333368b4052/mmh3-2.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4ca766a84a782f57dd0e213182a3c1da", "sha256": "185209a217c52afe43e079e5b232d0ef0f3a262601eaaf4371326ab6dcbec508" }, "downloads": -1, "filename": "mmh3-2.5.1.tar.gz", "has_sig": false, "md5_digest": "4ca766a84a782f57dd0e213182a3c1da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9797, "upload_time": "2017-10-31T13:44:56", "url": "https://files.pythonhosted.org/packages/fa/7e/3ddcab0a9fcea034212c02eb411433db9330e34d626360b97333368b4052/mmh3-2.5.1.tar.gz" } ] }