diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-29 05:00:11 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-05-29 05:00:11 +0200 |
commit | 2fe678653b7dd9f61dbbcd5e7d862360882bd7e8 (patch) | |
tree | 38c9dabad94845e848373b15788fcd7ae089218e /src/hash.h | |
parent | efcafca969d2e789cdf106609b04a86ef9b53a3d (diff) | |
download | fastd-2fe678653b7dd9f61dbbcd5e7d862360882bd7e8.tar fastd-2fe678653b7dd9f61dbbcd5e7d862360882bd7e8.zip |
Document *everything*
Diffstat (limited to 'src/hash.h')
-rw-r--r-- | src/hash.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -23,6 +23,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/** + \file + + An implementation of the Jenkins hash function + + \sa https://en.wikipedia.org/wiki/Jenkins_hash_function +*/ + #pragma once @@ -31,6 +39,7 @@ #include <stdint.h> +/** Adds data bytes to the 32bit hash value */ static inline void fastd_hash(uint32_t *hash, const void *data, size_t len) { size_t i; for (i = 0; i < len; ++i) { @@ -40,6 +49,7 @@ static inline void fastd_hash(uint32_t *hash, const void *data, size_t len) { } } +/** Finalizes a hash value */ static inline void fastd_hash_final(uint32_t *hash) { *hash += (*hash << 3); *hash ^= (*hash >> 11); |