BSD Ports

devel/mph 1.2 NetBSD

Minimal perfect hashing functionality

System
NetBSD
Repository
pkgsrc
Maintainer
[email protected]
Categories
devel
Package size
17.5 KiB, 66.3 KiB installed

Description

The program mph tries to generate an order preserving minimal perfect hashing (MPH) function for the set of keys, one per line, on stdin. Each key can be at most 4095 characters long (see keys.h to increase this limit), and the keys must be unique. If mph terminates, it emits a language independent binary or text representation of the MPH function on stdout. To generate a usable hash function, this output should be fed to a language dependent filter, like emitc.

e.g. % mph <foo | emitc >hash.c

The algorithm used by mph is probabilistic - it iterates until it finds a MPH function. For each failed iteration, it prints a (cryptic) reason on stderr. There is no no guarantee that mph will terminate. In practice this is unlikely, unless the constants specified with options -c or -m are too small (see below).

In the other systems

SystemPortVersion
NetBSDdevel/mph1.2
FreeBSDdevel/mph1.2
DragonFlydevel/mph1.2
HardenedBSDdevel/mph1.2
GhostBSDdevel/mph1.2

Install

Binary package:

pkgin install mph

From pkgsrc:

cd /usr/pkgsrc/devel/mph && make install clean

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

RepositoryVersion
NetBSD 10.1 x86_641.2
NetBSD 10.1 aarch641.2
SmartOS / illumos x86_641.2
macOS 15 arm641.2

Dependencies

No port depends on this one.