FNV1

Implementation of FNV1 digester.

FNV1 (Fowler–Noll–Vo) is a simple hash function that XORs each byte of the input data with a predefined constant and then multiplies the result by another predefined constant. The process is repeated for each byte in the data.

static
@digester
class FNV1 {}

Members

Static functions

hash
ubyte[] hash(ubyte[] data)

Computes the FNV1 hash digest of the given data.

Examples

import tern.digest.fnv1;

ubyte[] data = [1, 2, 3, 4, 5];
auto hashValue = FNV1.hash(data);

Meta