summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Wissner <belka@caraus.de>2018-10-25 20:05:21 +0200
committerGitHub <noreply@github.com>2018-10-25 20:05:21 +0200
commit64ceb0330cb89147fbe4d94902ce3ea2072a209a (patch)
tree978fe5c07484f8b6732bfee600474e2d244c5af5
parentff58b5e81c432157a799445d1b7075ce47efa5a2 (diff)
parentb230685595566ff0ca0da6ca3ac561a37cf05b14 (diff)
downloadtanya-64ceb0330cb89147fbe4d94902ce3ea2072a209a.tar.gz
Merge pull request #74 from n8sh/128-bit-fnv
Add FNV constants for size_t == ucent
-rw-r--r--source/tanya/hash/lookup.d5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/tanya/hash/lookup.d b/source/tanya/hash/lookup.d
index f0163ac..a509aae 100644
--- a/source/tanya/hash/lookup.d
+++ b/source/tanya/hash/lookup.d
@@ -29,6 +29,11 @@ private struct FNV
enum ulong offsetBasis = 14695981039346656037UL;
enum ulong prime = 1099511628211UL;
}
+ else static if (size_t.sizeof == 16)
+ {
+ enum size_t offsetBasis = (size_t(0x6c62272e07bb0142UL) << 64) + 0x62b821756295c58dUL;
+ enum size_t prime = (size_t(1) << 88) + (1 << 8) + 0x3b;
+ }
else
{
static assert(false, "FNV requires at least 32-bit hash length");