/*++ /* NAME /* hash_fnv 3 /* SUMMARY /* Fowler/Noll/Vo hash function /* SYNOPSIS /* #include <hash_fnv.h> /* /* HASH_FNV_T hash_fnv( /* const void *src, /* size_t len) /* /* HASH_FNV_T hash_fnvz( /* const char *src) /* DESCRIPTION /* hash_fnv() implements a modified FNV type 1a hash function. /* /* hash_fnvz() provides the same functionality for null-terminated /* strings, avoiding an unnecessary strlen() call. /* /* To thwart collision attacks, the hash function is seeded /* once with ldseed(). To disable seeding (typically, to make /* tests predictable), specify the NORANDOMIZE environment /* variable; the value does not matter. /* /* This implementation works around a "sticky state" problem /* with FNV hash functions: when an input produces a zero hash /* state, and the next input byte is zero, then the hash state /* would not change. To avoid this, hash_fnv() adds 1 to each /* input value. Compile with -DSTRICT_FNV1A to get the standard /* behavior. /* /* The default HASH_FNV_T result type is uint64_t. When compiled /* with -DUSE_FNV_32BIT, the result type is uint32_t. On ancient /* systems without <stdint.h>, define HASH_FNV_T on the compiler /* command line as an unsigned 32-bit or 64-bit integer type, /* and specify -DUSE_FNV_32BIT when HASH_FNV_T is a 32-bit type. /* SEE ALSO /* http://www.isthe.com/chongo/tech/comp/fnv/index.html /* https://softwareengineering.stackexchange.com/questions/49550/ /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* Google, Inc. /* 111 8th Avenue /* New York, NY 10011, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.