strhash(3pub)

strhash3pub

Hash function for strings

Usage

#include <publib.h>
unsigned long strhash(const char *s);

Overview

strhash is a hash function for strings. It uses an algorithm that tries to be good in most cases, but it is often possible to use a better algorithm that takes better into account the characteristics of the data for a given application. However, strhash often good enough; test it before spending time to develop a better one.

Return value

strhash returns the computed hash value. Note that the value is not scaled into any particular range (all values that an unsigned long can take are possible). The caller will have to do the scaling himself.

Releases

16 releases since Debian 1.2 (Rex); the text changed 4 times.

  1. 1.2–1.3
  2. 2.0–2.2
  3. 3.0
  4. 3.1–6.0
  5. 7–13

Author

Lars Wirzenius ([email protected])

From publib-dev 0.40-4 in Debian 13 (Trixie). Parsed by carta from the page's man source.