Get a string of English words as a fingerprint of any input data
Project description
wordhash
This project provides a command-line tool and a Python library to do this:
Given some arbitrary input data, output a fingerprint of that data in the form of a string of ordinary English words. If the input data changes even slightly, then the output will change completely.
It uses the EFF's large wordlist as a source of words.
Installation
pip install wordhash
Usage
Command-line interface (CLI)
$ wordhash -h
usage: wordhash [-h] [-w WORDLIST_PATH] [-l LENGTH]
(-f FILE | -s STRING)
options:
-h, --help show this help message and exit
-w WORDLIST_PATH, --wordlist WORDLIST_PATH
Path to a newline-delimted file containing
words to be used in the wordhash (default:
venv/lib64/python3.10/site-
packages/wordhash/data/wordlist.txt)
-l LENGTH, --length LENGTH
Length of hash digest for this program to use
internally. Determines number of words in the
resulting wordhash. (default: 8)
-f FILE, --file FILE Path to file to use as input data (default:
None)
-s STRING, --string STRING
String to use as input data (default: None)
$ wordhash -s 'the quick brown fox jumps over the lazy dog'
BackstabAuthenticDialDivingModifiedAbridge
$ echo -n 'the quick brown fox jumps over the lazy dog' > test.tx
t
$ wordhash -f test.txt
BackstabAuthenticDialDivingModifiedAbridge
Python library
>>> import wordhash
>>> mydata = b'the quick brown fox jumps over the lazy dog'
>>> wordhash.wordhash(mydata)
'BackstabAuthenticDialDivingModifiedAbridge'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wordhash-0.1.1.tar.gz.
File metadata
- Download URL: wordhash-0.1.1.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98bdef6025ceb46c7aae8d72a40c61919650b818794cb69b4bbea5109c988b2b
|
|
| MD5 |
b54539534aba2836e72ebf1d35620bc3
|
|
| BLAKE2b-256 |
6045ab6ee7309cd060d6cb66396cd0987f12254699c5ca48dd555bac3d75af3a
|
File details
Details for the file wordhash-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wordhash-0.1.1-py3-none-any.whl
- Upload date:
- Size: 55.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71baa3c2194476ea250b08d73fdee43258a19eceadccf90ca55a6f0335556d6d
|
|
| MD5 |
3fad41d2b6ebe68484fdf71060291ec2
|
|
| BLAKE2b-256 |
d5f686655ba6c09d5f86a84d7e861519bb55c96d74d0de3942af69a58f0a94ba
|