mmhash3 is a Python wrapper for MurmurHash (MurmurHash3), a collection of fast and robust non-cryptographic hash functions. This specific library (version 3.0.1, last updated Oct 2022) is a fork of the original 'mmh3' library, which was considered unmaintained at the time of its creation. For a more actively developed and current version of a MurmurHash3 Python wrapper, users often look to the 'mmh3' package (pypi.org/project/mmh3).
pip install mmhash3Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic hashing of strings using the default 32-bit algorithm, with and without a seed, and obtaining a 128-bit hash.
Always use `import mmh3` in your Python code.
Ensure your tests or dependent systems are updated to expect the hash values generated by current versions of MurmurHash3, or explicitly use older library versions if exact historical compatibility is critical and understood.
Use the `signed=False` keyword argument for `mmh3.hash()` or `mmh3.hash64()` to obtain unsigned values if needed for compatibility with other systems or libraries. Be aware that `hash64` always returns two values.
Ensure seed values are 32-bit integers. For compatibility with older systems using negative 32-bit seeds, ensure the implicit conversion behavior is understood.
Evaluate migrating to the actively maintained `mmh3` library (pip install mmh3) for ongoing support and features. Be aware of potential breaking changes if migrating, especially regarding endianness (mmh3 v4.0.0 made it endian-neutral) and seed handling.
Install the 'Microsoft C++ Build Tools' from the provided link or by selecting 'Desktop development with C++' in the Visual Studio Installer. For Linux, install `build-essential` (e.g., `sudo apt-get install build-essential`), and for macOS, install Xcode Command Line Tools (`xcode-select --install`).
Ensure you are in the correct Python environment. Try reinstalling the package using `pip install mmhash3`. If using a virtual environment, ensure it's activated. After successful installation, the module can be imported with `import mmh3`.
Ensure consistency across implementations by explicitly specifying parameters such as `signed=False` (to get unsigned results), `seed` (use the same seed value), and the `x64arch` parameter for 64-bit optimization when available (e.g., `mmh3.hash64('foo', seed=0, x64arch=True, signed=False)`). Also, ensure input strings are encoded consistently (e.g., `str.encode('utf-8')`).No dependency data recorded yet.