A collection of programs written in ponylang.io
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.
 
 
Wesley Kerfoot 950e2a5a50 Add bloom filter program with libfnv 5 years ago
..
autom4te.cache Add bloom filter program with libfnv 5 years ago
build-aux Add bloom filter program with libfnv 5 years ago
lib Add bloom filter program with libfnv 5 years ago
libfnv Add bloom filter program with libfnv 5 years ago
libfnvutil Add bloom filter program with libfnv 5 years ago
m4 Add bloom filter program with libfnv 5 years ago
man Add bloom filter program with libfnv 5 years ago
portable Add bloom filter program with libfnv 5 years ago
test Add bloom filter program with libfnv 5 years ago
tools Add bloom filter program with libfnv 5 years ago
AUTHORS Add bloom filter program with libfnv 5 years ago
COPYING Add bloom filter program with libfnv 5 years ago
ChangeLog Add bloom filter program with libfnv 5 years ago
INSTALL Add bloom filter program with libfnv 5 years ago
LICENSE Add bloom filter program with libfnv 5 years ago
Makefile Add bloom filter program with libfnv 5 years ago
Makefile.am Add bloom filter program with libfnv 5 years ago
Makefile.in Add bloom filter program with libfnv 5 years ago
NEWS Add bloom filter program with libfnv 5 years ago
README Add bloom filter program with libfnv 5 years ago
README.md Add bloom filter program with libfnv 5 years ago
aclocal.m4 Add bloom filter program with libfnv 5 years ago
autogen Add bloom filter program with libfnv 5 years ago
circle.yml Add bloom filter program with libfnv 5 years ago
config.h Add bloom filter program with libfnv 5 years ago
config.h.in Add bloom filter program with libfnv 5 years ago
config.h.in~ Add bloom filter program with libfnv 5 years ago
config.log Add bloom filter program with libfnv 5 years ago
config.status Add bloom filter program with libfnv 5 years ago
configure Add bloom filter program with libfnv 5 years ago
configure.ac Add bloom filter program with libfnv 5 years ago
libtool Add bloom filter program with libfnv 5 years ago
stamp-h1 Add bloom filter program with libfnv 5 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