From 7667854cfaa84b9372cedd880d71339274d134c8 Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Wed, 19 Nov 2025 13:05:28 +0100 Subject: 26_a_2: Add solution --- ch26/26_a_2/cbits/lookup3.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ch26/26_a_2/cbits/lookup3.h (limited to 'ch26/26_a_2/cbits/lookup3.h') diff --git a/ch26/26_a_2/cbits/lookup3.h b/ch26/26_a_2/cbits/lookup3.h new file mode 100644 index 0000000..7591eba --- /dev/null +++ b/ch26/26_a_2/cbits/lookup3.h @@ -0,0 +1,23 @@ +/** snippet header */ +/* save this file as lookup3.h */ + +#ifndef _lookup3_h +#define _lookup3_h + +#include +#include + +/* only accepts uint32_t aligned arrays of uint32_t */ +void hashword2(const uint32_t *key, /* array of uint32_t */ + size_t length, /* number of uint32_t values */ + uint32_t *pc, /* in: seed1, out: hash1 */ + uint32_t *pb); /* in: seed2, out: hash2 */ + +/* handles arbitrarily aligned arrays of bytes */ +void hashlittle2(const void *key, /* array of bytes */ + size_t length, /* number of bytes */ + uint32_t *pc, /* in: seed1, out: hash1 */ + uint32_t *pb); /* in: seed2, out: hash2 */ + +#endif /* _lookup3_h */ +/** /snippet header */ -- cgit v1.2.3