simhash
simhash cpp module for python, a cpp implement of simhash, support for large dimesion such as 128bit
install
pip install pysimhash
or install from github.com
git clone https://github.com/skiloop/simhash
cd simhash
python setup.py install
requirements
- boost-python
how to use
example:
import pysimhash
import hashlib
document = "google.com hybridtheory.com youtube.com reddit.com"
tokens = [hashlib.md5(s.encode('utf-8')).hexdigest() for s in document.split(" ")]
s2 = pysimhash.SimHash(128, 16) # f=128, hash_bit=16
s2.build(tokens, base=16)
print(s2.hex())
benchmark
With 10000 creating and 100,000 comparing(using benchmark.py) on the same linux, results go as follow
| implement | build time | comparison time |
|---|---|---|
| pure python | 1.73s | 222.99s |
| pysimhash | 0.14s | 49.89s |
Metadata
Release files for pysimhash 1.1.1
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 |
|---|---|---|---|---|
| pysimhash-1.1.1.tar.gz | 8.5 kB | Without provenance | Details for pysimhash-1.1.1.tar.gz |
Release files / pysimhash-1.1.1.tar.gz
| Download URL | pysimhash-1.1.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b05ea5e2b41fd368a1c12d7d505f17cd828d73f340570e01b4348ea2c18a315d
|
|
BLAKE2b-256 checksum How to use checksums |
37588dbdd3eb93f3d33a0f2f3d6e62412f3e26c2bbc66c34fa8ddd6db225fd37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.0
|
Security for pysimhash 1.1.1
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.