Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordhash-0.1.1.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordhash-0.1.1-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

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

Hashes for wordhash-0.1.1.tar.gz
Algorithm Hash digest
SHA256 98bdef6025ceb46c7aae8d72a40c61919650b818794cb69b4bbea5109c988b2b
MD5 b54539534aba2836e72ebf1d35620bc3
BLAKE2b-256 6045ab6ee7309cd060d6cb66396cd0987f12254699c5ca48dd555bac3d75af3a

See more details on using hashes here.

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

Hashes for wordhash-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71baa3c2194476ea250b08d73fdee43258a19eceadccf90ca55a6f0335556d6d
MD5 3fad41d2b6ebe68484fdf71060291ec2
BLAKE2b-256 d5f686655ba6c09d5f86a84d7e861519bb55c96d74d0de3942af69a58f0a94ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page