A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
FNV Hash Implementation
+ Collaboration diagram for FNV Hash Implementation:

Macros

#define __FNV_H__
 Include guard from the original fnv.h.
 
#define FNV0_32_INIT   ((Fnv1aImplementation::Fnv32_t)0)
 32 bit FNV-0 zero initial basis
 
#define FNV0_64_INIT   ((Fnv1aImplementation::Fnv64_t)0)
 64 bit FNV-0 zero initial basis
 
#define FNV1_32_INIT   ((Fnv1aImplementation::Fnv32_t)0x811c9dc5)
 32 bit FNV-1 and FNV-1a non-zero initial basis
 
#define FNV1_32A_INIT   FNV1_32_INIT
 32 bit FNV-1 and FNV-1a non-zero initial basis
 
#define FNV1_64_INIT   ((Fnv1aImplementation::Fnv64_t)0xcbf29ce484222325ULL)
 64 bit FNV-1 non-zero initial basis
 
#define FNV1A_64_INIT   FNV1_64_INIT
 64 bit FNV-1 non-zero initial basis
 
#define FNV_32_PRIME   ((Fnv1aImplementation::Fnv32_t)0x01000193)
 32 bit magic FNV-1a prime
 
#define FNV_VERSION   "5.0.2"
 @(#) FNV Version
 
#define HAVE_64BIT_LONG_LONG
 Determine how 64 bit unsigned values are represented.
 

Typedefs

typedef uint32_t ns3::Hash::Function::Fnv1aImplementation::Fnv32_t
 32 bit FNV-0 hash type
 
typedef uint64_t ns3::Hash::Function::Fnv1aImplementation::Fnv64_t
 64 bit FNV-0 hash
 

Enumerations

enum  ns3::Hash::Function::Fnv1aImplementation::fnv_type {
  ns3::Hash::Function::Fnv1aImplementation::FNV_NONE = 0 , ns3::Hash::Function::Fnv1aImplementation::FNV0_32 = 1 , ns3::Hash::Function::Fnv1aImplementation::FNV1_32 = 2 , ns3::Hash::Function::Fnv1aImplementation::FNV1a_32 = 3 ,
  ns3::Hash::Function::Fnv1aImplementation::FNV0_64 = 4 , ns3::Hash::Function::Fnv1aImplementation::FNV1_64 = 5 , ns3::Hash::Function::Fnv1aImplementation::FNV1a_64 = 6
}
 FNV hash types. More...
 

Functions

Fnv32_t ns3::Hash::Function::Fnv1aImplementation::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
 
Fnv32_t ns3::Hash::Function::Fnv1aImplementation::fnv_32_str (char *str, Fnv32_t hval)
 fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string
 
Fnv32_t ns3::Hash::Function::Fnv1aImplementation::fnv_32a_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
 
Fnv32_t ns3::Hash::Function::Fnv1aImplementation::fnv_32a_str (char *str, Fnv32_t hval)
 fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string
 
Fnv64_t ns3::Hash::Function::Fnv1aImplementation::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 ns3::Hash::Function::Fnv1aImplementation::fnv_64_str (char *str, Fnv64_t hval)
 fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer
 
Fnv64_t ns3::Hash::Function::Fnv1aImplementation::fnv_64a_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 ns3::Hash::Function::Fnv1aImplementation::fnv_64a_str (char *str, Fnv64_t hval)
 fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer
 
#define FNV_64_PRIME   ((Fnv1aImplementation::Fnv64_t)0x100000001b3ULL)
 FNV-1a defines the initial basis to be non-zero.
 

Detailed Description

Macro Definition Documentation

◆ __FNV_H__

#define __FNV_H__

Include guard from the original fnv.h.

Definition at line 146 of file hash-fnv.cc.

◆ FNV0_32_INIT

#define FNV0_32_INIT   ((Fnv1aImplementation::Fnv32_t)0)

32 bit FNV-0 zero initial basis

This historic hash is not recommended. One should use the FNV-1 hash and initial basis instead.

Definition at line 167 of file hash-fnv.cc.

◆ FNV0_64_INIT

#define FNV0_64_INIT   ((Fnv1aImplementation::Fnv64_t)0)

64 bit FNV-0 zero initial basis

This historic hash is not recommended. One should use the FNV-1 hash and initial basis instead.

Definition at line 216 of file hash-fnv.cc.

◆ FNV1_32_INIT

#define FNV1_32_INIT   ((Fnv1aImplementation::Fnv32_t)0x811c9dc5)

32 bit FNV-1 and FNV-1a non-zero initial basis

The FNV-1 initial basis is the FNV-0 hash of the following 32 octets:

         chongo <Landon Curt Noll> /\../\
Note
The \'s above are not back-slashing escape characters. They are literal ASCII backslash 0x5c characters.
The FNV-1a initial basis is the same value as FNV-1 by definition.

Definition at line 183 of file hash-fnv.cc.

◆ FNV1_32A_INIT

#define FNV1_32A_INIT   FNV1_32_INIT

32 bit FNV-1 and FNV-1a non-zero initial basis

The FNV-1 initial basis is the FNV-0 hash of the following 32 octets:

         chongo <Landon Curt Noll> /\../\
Note
The \'s above are not back-slashing escape characters. They are literal ASCII backslash 0x5c characters.
The FNV-1a initial basis is the same value as FNV-1 by definition.

Definition at line 185 of file hash-fnv.cc.

Referenced by ns3::Hash::Function::Fnv1a::clear().

◆ FNV1_64_INIT

#define FNV1_64_INIT   ((Fnv1aImplementation::Fnv64_t)0xcbf29ce484222325ULL)

64 bit FNV-1 non-zero initial basis

The FNV-1 initial basis is the FNV-0 hash of the following 32 octets:

         chongo <Landon Curt Noll> /\../\
Note
The \'s above are not back-slashing escape characters. They are literal ASCII backslash 0x5c characters.
The FNV-1a initial basis is the same value as FNV-1 by definition.

Definition at line 236 of file hash-fnv.cc.

◆ FNV1A_64_INIT

#define FNV1A_64_INIT   FNV1_64_INIT

64 bit FNV-1 non-zero initial basis

The FNV-1 initial basis is the FNV-0 hash of the following 32 octets:

         chongo <Landon Curt Noll> /\../\
Note
The \'s above are not back-slashing escape characters. They are literal ASCII backslash 0x5c characters.
The FNV-1a initial basis is the same value as FNV-1 by definition.

Definition at line 238 of file hash-fnv.cc.

Referenced by ns3::Hash::Function::Fnv1a::clear().

◆ FNV_32_PRIME

#define FNV_32_PRIME   ((Fnv1aImplementation::Fnv32_t)0x01000193)

◆ FNV_64_PRIME

#define FNV_64_PRIME   ((Fnv1aImplementation::Fnv64_t)0x100000001b3ULL)

FNV-1a defines the initial basis to be non-zero.

64 bit magic FNV-1a prime

Definition at line 515 of file hash-fnv.cc.

Referenced by ns3::Hash::Function::Fnv1aImplementation::fnv_64a_buf(), and ns3::Hash::Function::Fnv1aImplementation::fnv_64a_str().

◆ FNV_VERSION

#define FNV_VERSION   "5.0.2"

@(#) FNV Version

Definition at line 151 of file hash-fnv.cc.

◆ HAVE_64BIT_LONG_LONG

#define HAVE_64BIT_LONG_LONG

Determine how 64 bit unsigned values are represented.

Definition at line 192 of file hash-fnv.cc.

Typedef Documentation

◆ Fnv32_t

32 bit FNV-0 hash type

Definition at line 157 of file hash-fnv.cc.

◆ Fnv64_t

64 bit FNV-0 hash

Definition at line 200 of file hash-fnv.cc.

Enumeration Type Documentation

◆ fnv_type

FNV hash types.

Enumerator
FNV_NONE 

invalid FNV hash type

FNV0_32 

FNV-0 32 bit hash.

FNV1_32 

FNV-1 32 bit hash.

FNV1a_32 

FNV-1a 32 bit hash.

FNV0_64 

FNV-0 64 bit hash.

FNV1_64 

FNV-1 64 bit hash.

FNV1a_64 

FNV-1a 64 bit hash.

Definition at line 251 of file hash-fnv.cc.

Function Documentation

◆ fnv_32_buf()

Fnv32_t ns3::Hash::Function::Fnv1aImplementation::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

input:

Parameters
[in]bufstart of buffer to hash
[in]lenlength of buffer in octets
[in]hvalprevious hash value or 0 if first call
Returns
32 bit hash as a static hash type.
Note
To use the recommended 32 bit FNV-1a hash, use FNV1_32A_INIT as the hval arg on the first call to either fnv_32a_buf() or fnv_32a_str().

◆ fnv_32_str()

Fnv32_t ns3::Hash::Function::Fnv1aImplementation::fnv_32_str ( char * str,
Fnv32_t hval )

fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string

input:

Parameters
[in]strstring to hash
[in]hvalprevious hash value or 0 if first call
Returns
32 bit hash as a static hash type
Note
To use the recommended 32 bit FNV-1a hash, use FNV1_32A_INIT as the hval arg on the first call to either fnv_32a_buf() or fnv_32a_str().

◆ fnv_32a_buf()

Fnv32_t ns3::Hash::Function::Fnv1aImplementation::fnv_32a_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

input:

Parameters
[in]bufstart of buffer to hash
[in]lenlength of buffer in octets
[in]hvalprevious hash value or 0 if first call
Returns
32 bit hash as a static hash type.
Note
To use the recommended 32 bit FNV-1a hash, use FNV1_32A_INIT as the hval arg on the first call to either fnv_32a_buf() or fnv_32a_str().

Definition at line 374 of file hash-fnv.cc.

References FNV_32_PRIME.

Referenced by ns3::Hash::Function::Fnv1a::GetHash32().

+ Here is the caller graph for this function:

◆ fnv_32a_str()

Fnv32_t ns3::Hash::Function::Fnv1aImplementation::fnv_32a_str ( char * str,
Fnv32_t hval )

fnv_32a_str - perform a 32 bit Fowler/Noll/Vo FNV-1a hash on a string

input:

Parameters
[in]strstring to hash
[in]hvalprevious hash value or 0 if first call
Returns
32 bit hash as a static hash type
Note
To use the recommended 32 bit FNV-1a hash, use FNV1_32A_INIT as the hval arg on the first call to either fnv_32a_buf() or fnv_32a_str().

Definition at line 413 of file hash-fnv.cc.

References FNV_32_PRIME.

◆ fnv_64_buf()

Fnv64_t ns3::Hash::Function::Fnv1aImplementation::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

input:

Parameters
[in]bufstart of buffer to hash
[in]lenlength of buffer in octets
[in]hvalprevious hash value or 0 if first call
Returns
64 bit hash as a static hash type
Note
To use the recommended 64 bit FNV-1a hash, use FNV1A_64_INIT as the hval arg on the first call to either fnv_64a_buf() or fnv_64a_str().

◆ fnv_64_str()

Fnv64_t ns3::Hash::Function::Fnv1aImplementation::fnv_64_str ( char * str,
Fnv64_t hval )

fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer

input:

Parameters
[in]strstring to hash
[in]hvalprevious hash value or 0 if first call
Returns
64 bit hash as a static hash type
Note
To use the recommended 64 bit FNV-1a hash, use FNV1A_64_INIT as the hval arg on the first call to either fnv_64a_buf() or fnv_64a_str().

◆ fnv_64a_buf()

Fnv64_t ns3::Hash::Function::Fnv1aImplementation::fnv_64a_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

input:

Parameters
[in]bufstart of buffer to hash
[in]lenlength of buffer in octets
[in]hvalprevious hash value or 0 if first call
Returns
64 bit hash as a static hash type
Note
To use the recommended 64 bit FNV-1a hash, use FNV1A_64_INIT as the hval arg on the first call to either fnv_64a_buf() or fnv_64a_str().

Definition at line 537 of file hash-fnv.cc.

References FNV_64_PRIME.

Referenced by ns3::Hash::Function::Fnv1a::GetHash64().

+ Here is the caller graph for this function:

◆ fnv_64a_str()

Fnv64_t ns3::Hash::Function::Fnv1aImplementation::fnv_64a_str ( char * str,
Fnv64_t hval )

fnv_64a_str - perform a 64 bit Fowler/Noll/Vo FNV-1a hash on a buffer

input:

Parameters
[in]strstring to hash
[in]hvalprevious hash value or 0 if first call
Returns
64 bit hash as a static hash type
Note
To use the recommended 64 bit FNV-1a hash, use FNV1A_64_INIT as the hval arg on the first call to either fnv_64a_buf() or fnv_64a_str().

Definition at line 642 of file hash-fnv.cc.

References FNV_64_PRIME.