46namespace Fnv1aImplementation
144#if !defined(__FNV_H__)
151#define FNV_VERSION "5.0.2"
167#define FNV0_32_INIT ((Fnv1aImplementation::Fnv32_t)0)
183#define FNV1_32_INIT ((Fnv1aImplementation::Fnv32_t)0x811c9dc5)
185#define FNV1_32A_INIT FNV1_32_INIT
192#define HAVE_64BIT_LONG_LONG
199#if defined(HAVE_64BIT_LONG_LONG)
215#if defined(HAVE_64BIT_LONG_LONG)
216#define FNV0_64_INIT ((Fnv1aImplementation::Fnv64_t)0)
219#define FNV0_64_INIT (Fnv1aImplementation::fnv0_64_init)
235#if defined(HAVE_64BIT_LONG_LONG)
236#define FNV1_64_INIT ((Fnv1aImplementation::Fnv64_t)0xcbf29ce484222325ULL)
238#define FNV1A_64_INIT FNV1_64_INIT
242#define FNV1_64_INIT (fnv1_64_init)
244#define FNV1A_64_INIT (fnv1a_64_init)
357#define FNV_32_PRIME ((Fnv1aImplementation::Fnv32_t)0x01000193)
376 unsigned char *
bp = (
unsigned char *)buf;
388#if defined(NO_FNV_GCC_OPTIMIZATION)
415 unsigned char *s = (
unsigned char *)str;
426#if defined(NO_FNV_GCC_OPTIMIZATION)
505#if !defined(HAVE_64BIT_LONG_LONG)
514#if defined(HAVE_64BIT_LONG_LONG)
515#define FNV_64_PRIME ((Fnv1aImplementation::Fnv64_t)0x100000001b3ULL)
517#define FNV_64_PRIME_LOW ((unsigned long)0x1b3)
518#define FNV_64_PRIME_SHIFT (8)
539 unsigned char *
bp = (
unsigned char *)buf;
542#if defined(HAVE_64BIT_LONG_LONG)
552#if defined(NO_FNV_GCC_OPTIMIZATION)
562 unsigned long val[4];
563 unsigned long tmp[4];
644 unsigned char *s = (
unsigned char *)str;
646#if defined(HAVE_64BIT_LONG_LONG)
657#if defined(NO_FNV_GCC_OPTIMIZATION)
667 unsigned long val[4];
668 unsigned long tmp[4];
718 val[0] ^= (
unsigned long)(*s++);
uint32_t m_hash32
Cache last hash value, for incremental hashing.
uint32_t GetHash32(const char *buffer, const size_t size) override
Compute 32-bit hash of a byte buffer.
uint64_t GetHash64(const char *buffer, const size_t size) override
Compute 64-bit hash of a byte buffer.
uint64_t m_hash64
Cache last hash value, for incremental hashing.
void clear() override
Restore initial state.
uint64_t Fnv64_t
64 bit FNV-0 hash
#define FNV1A_64_INIT
64 bit FNV-1 non-zero initial basis
#define FNV1_32A_INIT
32 bit FNV-1 and FNV-1a non-zero initial basis
Fnv32_t fnv_32_str(char *str, Fnv32_t hval)
fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string
Fnv64_t fnv_64_str(char *str, Fnv64_t hval)
fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer
Fnv32_t fnv_32a_str(char *buf, Fnv32_t hashval)
fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string
#define FNV_64_PRIME
FNV-1a defines the initial basis to be non-zero.
uint32_t Fnv32_t
32 bit FNV-0 hash type
Fnv64_t fnv_64_buf(void *buf, size_t len, Fnv64_t hval)
fnv_64a_buf - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer
Fnv64_t fnv_64a_str(char *buf, Fnv64_t hashval)
fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer
Fnv32_t fnv_32_buf(void *buf, size_t len, Fnv32_t hval)
fnv_32a_buf - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a buffer
#define FNV_32_PRIME
32 bit magic FNV-1a prime
Fnv32_t fnv_32a_buf(void *buf, size_t len, Fnv32_t hashval)
fnv_32a_buf - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a buffer
Fnv64_t fnv_64a_buf(void *buf, size_t len, Fnv64_t hashval)
fnv_64a_buf - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer
@ FNV1a_32
FNV-1a 32 bit hash.
@ FNV1_64
FNV-1 64 bit hash.
@ FNV1a_64
FNV-1a 64 bit hash.
@ FNV_NONE
invalid FNV hash type
@ FNV0_64
FNV-0 64 bit hash.
@ FNV0_32
FNV-0 32 bit hash.
@ FNV1_32
FNV-1 32 bit hash.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
ns3::Hash::Function::Fnv1a declaration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.