mrshw
Thin, ctypes-based Python bindings for the mrsh CLI tool. Implements the Bloom-filter–based similarity hashing algorithm originally proposed by Frank Breitinger and Harald Baier in their paper Similarity Preserving Hashing: Eligible Properties and a new Algorithm MRSH-v2 (da/sec Biometrics and Internet Security Research Group, Hochschule Darmstadt). Use Bloom-filter–based fingerprinting directly from Python with minimal overhead.
Installation
Install from PyPI:
pip install mrshw
Or directly from GitHub (tagged release v1.0.0):
pip install git+https://github.com/w4term3loon/mrsh.git@v1.0.0
Quick start
import mrsh
# Target
file = "file.bin"
# Generate hash
hash_path = mrsh.hash(file) # labeled: 'file.bin'
hash_binary = mrsh.hash(open(file, 'rb').read())
# Arbitrary binary data hash
hash_labeled_binary = mrsh.hash((b"cafebabe", data_name))
# Calculate similarity score
similarity_score = mrsh.diff(hash_path, hash_binary)
assert(similarity_score == 100)
# Create and compare hashes with metadata
fp1 = mrsh.Fingerprint("file1.bin")
fp2 = mrsh.Fingerprint("file2.bin")
similarity = fp1.compare(fp2)
# Batch operations
fpl = mrsh.FingerprintList()
fpl.add("file1.bin")
fpl.add("file2.bin")
results = fpl.compare_all(threshold=50)
License
- Wrapper code: MIT License. See the LICENSE file for full terms.
- Underlying C library: Apache License 2.0. See its repository license.
Metadata
Release files for mrshw 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mrshw-1.0.0.tar.gz | 24.5 kB | Without provenance | Details for mrshw-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mrshw-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for mrshw-1.0.0-py3-none-any.whl |
Total release size: 48.0 kB
Release files / mrshw-1.0.0.tar.gz
| Download URL | mrshw-1.0.0.tar.gz |
|---|---|
| Size | 24.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9386053bb01c669fa0cb089f754342245ff6622d16f856a725a6b03116f7541d
|
|
BLAKE2b-256 checksum How to use checksums |
ccec90464f92ffe8a8f4a4cadd5df7f08eacc06451e195dcad23c69a3551fd73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / mrshw-1.0.0-py3-none-any.whl
| Download URL | mrshw-1.0.0-py3-none-any.whl |
|---|---|
| Size | 23.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea34d8571a74eee8cc6663368bf5cad99d7ac5389244b8c67aa86f637a2497f9
|
|
BLAKE2b-256 checksum How to use checksums |
60477a2cad7163f7681878613c1f4e6715e9f245dcdfa652e51a7771f61476a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for mrshw 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.