1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
/*
This algorithm is in the public domain. This code was
derived from code in the public domain.
http://www.isthe.com/chongo/tech/comp/fnv/
Currently implemented FNV-1a 32bit and FNV-1a 64bit
*/
#include "ts/HashFNV.h"
static const uint32_t FNV_INIT_32 = 0x811c9dc5u;
static const uint64_t FNV_INIT_64 = 0xcbf29ce484222325ull;
// FNV-1a 64bit
ATSHash32FNV1a::ATSHash32FNV1a(void)
{
this->clear();
}
void
ATSHash32FNV1a::final(void)
{
}
uint32_t
ATSHash32FNV1a::get(void) const
{
return hval;
}
void
ATSHash32FNV1a::clear(void)
{
hval = FNV_INIT_32;
}
// FNV-1a 64bit
ATSHash64FNV1a::ATSHash64FNV1a(void)
{
this->clear();
}
void
ATSHash64FNV1a::final(void)
{
}
uint64_t
ATSHash64FNV1a::get(void) const
{
return hval;
}
void
ATSHash64FNV1a::clear(void)
{
hval = FNV_INIT_64;
}
|