Fast and simple bloom filters in C and Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
wes 7a8efaf64f bundle libfnv 7 years ago
..
autom4te.cache bundle libfnv 7 years ago
build-aux bundle libfnv 7 years ago
lib bundle libfnv 7 years ago
libfnv bundle libfnv 7 years ago
libfnvutil bundle libfnv 7 years ago
m4 bundle libfnv 7 years ago
man bundle libfnv 7 years ago
portable bundle libfnv 7 years ago
tools bundle libfnv 7 years ago
AUTHORS bundle libfnv 7 years ago
COPYING bundle libfnv 7 years ago
ChangeLog bundle libfnv 7 years ago
INSTALL bundle libfnv 7 years ago
LICENSE bundle libfnv 7 years ago
Makefile bundle libfnv 7 years ago
Makefile.am bundle libfnv 7 years ago
Makefile.in bundle libfnv 7 years ago
NEWS bundle libfnv 7 years ago
README bundle libfnv 7 years ago
README.md bundle libfnv 7 years ago
aclocal.m4 bundle libfnv 7 years ago
autogen bundle libfnv 7 years ago
circle.yml bundle libfnv 7 years ago
config.h bundle libfnv 7 years ago
config.h.in bundle libfnv 7 years ago
config.h.in~ bundle libfnv 7 years ago
config.log bundle libfnv 7 years ago
config.status bundle libfnv 7 years ago
configure bundle libfnv 7 years ago
configure.ac bundle libfnv 7 years ago
libtool bundle libfnv 7 years ago
stamp-h1 bundle libfnv 7 years ago

README.md

libfnv

C language FNV hash function library with all supported bit lengths of FNV-1a: 32, 64, 128, 256, 512, and 1024

Compilation instructions

Clone from repo:

git clone https://github.com/fnvhash/libfnv.git

OR


download a release and extract it.
tar xvfz libfnv*tar*

cd into the extracted directory:

cd libfnv*

Use ls to find out if there is a configure script.

ls -l configure

If not, run:

./autogen

Once the configure script is available, compilation is as normal for all autoconf enabled projects:

./configure
make
sudo make install

Compiling and Running your Own Programs

Once the package is installed, it may easily be compiled and linked with:
gcc my_prog.c -o my_prog --static `pkg-config --libs --cflags libfnv`

In C, the library follows standard conventions. my_prog.c can be as simple as:

#include <stdio.h>
#include <fnv.h>

int main(int argc, char **argv) {
  const char *test_string = "foobar";
  uint64_t hval;
  char result[17];
  fnv64Init(&hval);
  fnv64UpdateBuffer(&hval, test_string, 6);
  fnv64ResultHex(result, &hval);
  printf("%s\n", result);
  return 0;
}

After you have compiled the example program above, you may try running it to verify the results of computing the 64-bit FNV-1a hash of the 6-byte string foobar.

./my_prog

Prepackaged Command Line Tools

This library includes a set of command line tools that may be used to compute FNV-1a hashes in any size. Simply select a bit size from 32, 64, 128, 256, 512, or 1024 and enter a command:
fnv64sum [FILE]

All four bit sizes are supported with the corresponding command names.

To test or verify your own FNV implementation, you may use this library or another one such as this online FNV hash calculator.

On a modern consumer-grade computer, this library is able to process about a gigabyte of data per second using fnv32sum and fnv64sum, or about 100 megabytes per second using fnv128sum or fnv256sum.

Downloads of Releases