X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fhash.cpp;h=aed9ed19d2aa522c33b9e047c1d2bca7b89e87ec;hp=fe5e339c5aedc9ff0691ada988705fa0e6949898;hb=b116e161e377da0e4e52f07745ecb2d22f962ae9;hpb=062b200b08ec5998c4c02326e1e7b4e71fe4a5c6 diff --git a/source/core/hash.cpp b/source/core/hash.cpp index fe5e339..aed9ed1 100644 --- a/source/core/hash.cpp +++ b/source/core/hash.cpp @@ -10,7 +10,7 @@ http://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function http://www.isthe.com/chongo/tech/comp/fnv/index.html */ -UInt32 hash32(const void *data, unsigned size, unsigned bits) +uint32_t hash32(const void *data, unsigned size, unsigned bits) { if(bits==0 || bits>32) throw invalid_argument("hash32"); @@ -28,15 +28,15 @@ UInt32 hash32(const void *data, unsigned size, unsigned bits) return result; } -UInt64 hash64(const void *data, unsigned size, unsigned bits) +uint64_t hash64(const void *data, unsigned size, unsigned bits) { if(bits==0 || bits>64) throw invalid_argument("hash64"); - static const UInt64 prime = 1099511628211ULL; - static const UInt64 offset = 14695981039346656037ULL; + static const uint64_t prime = 1099511628211ULL; + static const uint64_t offset = 14695981039346656037ULL; - UInt64 result = offset; + uint64_t result = offset; for(unsigned i=0; i(data)+i))*prime;