CMPH(1)
β¨ CMPH(1) β¨
okay bestie, gather round, because today we're learning about cmph, the minimum perfect hashing tool π (that's the manual name btw, CMPH(1), section 1, we love her)
πΈ NAME πΈ
cmph β minimum perfect hashing tool π
π SYNOPSIS π
cmph [-v] [-h] [-V] [-k nkeys] [-f hash_function] [-g [-c value][-s
seed] ] [-a algorithm] [-M memory_in_MB] [-b BRZ_parameter] [-d tmp_dir]
[-m file.mph] keysfile
π DESCRIPTION π
It's a command line tool that generates and queries minimal perfect hash functions. That's the whole vibe. π¦
For the full documentation, please refer to http://cmph.sf.net β the source site, no cap. β¨
-hβ Print an help message π-cβ This value determines: the number of vertices in the graph for the algorithmsBMZandCHM; the number of bits per key required in theFCHalgorithm-aβ Algorithm. Valid values are:bmz,bmz8,chm,brz,fch-fβ hash function (may be used multiple times). valid values are:djb2,fnv,jenkins,sdbm-Vβ Print version number and exit-vβ Increase verbosity (may be used multiple times)-kβ Number of keys-gβ Generation mode-sβ Random seed-mβ Minimum perfect hash function file-Mβ Main memory availability (in MB)-dβ Temporary directory used inbrzalgorithm-bβ Parameter ofBRZalgorithm to make the maximal number of keys in a bucket lower than 256keysfileβ Line separated file with keys π
π EXAMPLE π
$ # Using the default algorithm (chm) for constructing a mphf
$ # for keys in file keys_file. Lines in keys_file _must_ be unique.
$ ./cmph -v -g keys_file
$ # Query id of keys in the file keys_query
$ ./cmph -v -m keys_file.mph keys_query
bestie the lines in keys_file MUST be unique, that's not a suggestion, that's the law π
π AUTHOR π
This manual page was written by Enrico Tassi <gareuselesinge@users.sourceforge.net>, for the Debian project (but may be used by others). π«Ά
okay that's the whole thing, go forth and hash perfectly πβ¨ this was cmph version 0.6, dated October 2007, and honestly? iconic. periodt. ππΈ
π¦ where this page comes from
- alpine 3.22: cmph-doc 2.0.2-r6 Β· LGPL-2.0-or-later AND MPL-1.1
- alpine 3.23: cmph-doc 2.0.2-r6 Β· LGPL-2.0-or-later AND MPL-1.1
- alpine 3.24: cmph-doc 2.0.2-r6 Β· LGPL-2.0-or-later AND MPL-1.1
- debian bookworm: libcmph-tools 2.0.2-2 Β· GPL-2.0-or-later OR MPL-1.1
- debian trixie: libcmph-tools 2.0.2-3.1 Β· GPL-2.0-or-later OR MPL-1.1
- nixos 26.05: cmph 2.0.2
- nixpkgs unstable: cmph 2.0.2
- ubuntu jammy: libcmph-tools 2.0.2-2 Β· GPL-2.0-or-later OR MPL-1.1
- ubuntu noble: libcmph-tools 2.0.2-3.1build1 Β· GPL-2.0-or-later OR MPL-1.1
- ubuntu questing: libcmph-tools 2.0.2-3.1build1
- ubuntu resolute: libcmph-tools 2.0.2-4 Β· LGPL-2.0-only OR MPL-1.1
- ubuntu stonking: libcmph-tools 2.0.2-4 Β· LGPL-2.0-only OR MPL-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms