pph
pph generates a minimal order-preserving hash function for a list of keys.
Reference:
Practical perfect hashing GV Cormack, RNS Horspool, M Kaiserswerth - The Computer Journal, 1985
Table of Contents
License
This project is licensed under the Apache License, Version 2.0.
Building
This library uses the Boost library.
export LDFLAGS="$LDFLAGS -L/path/to/boost/lib"
export CPPFLAGS="$CPPFLAGS -I/path/to/boost/include"
pph uses CMake for its build system.
mkdir build
cd build
cmake ..
make
Using
The basic command line to generate a hash function from a file containing a list of strings (one per line) is:
pph -i ./file.txt -o ./file.hash
The command line to verify an existing hash function is:
pph --verify ./file.hash
The other command line options can be seen by typing:
pph --help
The default timeout for creating a hash function is 60000 milliseconds (1 minute).
If a hash function is not generated, you can try sorting the input file:
pph -i file.txt --index > file_index.txt
sort --numeric-sort --key=2 file_index.txt > file_sorted_index.txt
awk -F' ' '{print $1}' file_sorted_index.txt > file_sorted.txt
Python
This library uses the Boost library. Install the Boost library and set LDFLAGS and CPPFLAGS before installing the Python module.
export LDFLAGS="$LDFLAGS -L/path/to/boost/lib"
export CPPFLAGS="$CPPFLAGS -I/path/to/boost/include"
Install the module.
pip3 install pph
Import the module.
from pph import PphHashTable, PphRandomNumber, PphKeyFunctions
See the tests for how to generate a hash function using the Python interface.
Metadata
Release files for pph 0.2.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 |
|---|---|---|---|---|
| pph-0.2.0.tar.gz | 156.4 kB | Without provenance | Details for pph-0.2.0.tar.gz |
Release files / pph-0.2.0.tar.gz
| Download URL | pph-0.2.0.tar.gz |
|---|---|
| Size | 156.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
107a3cd5bcd4b84d9f44cf4bc71b733cd58a0cd231435ab3177c069cad1e9189
|
|
BLAKE2b-256 checksum How to use checksums |
eabbd429257b1804640026dc431895e8fadda414b4b26fda90fc5afe992500d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Security for pph 0.2.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.