Quick Start

Install fnvhash-c

Supports python3.5 or later.

  • Install from PyPI:

pip instal fnvhash-c

Basic Usage

Use fnvhash_c.fnv1a?_(32|64) to call a hash function , which accepts a python string OR bytes type object.

Since depreciated, we only implemented the 32-bit and 64-bit versions of fnv1 and fnv1a, and did not implement fnv0.

import fnvhash_c

print(fnvhash_c.fnv1_32(b'Hello world!'))
print(fnvhash_c.fnv1a_32(b'Hello world!'))
print(fnvhash_c.fnv1_64(b'Hello world!'))
print(fnvhash_c.fnv1a_64(b'Hello world!'))
assert fnvhash_c.fnv1a_64('Hello world!'.encode()) == fnvhash_c.fnv1a_64('Hello world!')