A Discrete-Event Network Simulator
API
FNV Hash Implementation
+ Collaboration diagram for FNV Hash Implementation:

Macros

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

Typedefs

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

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
More...
 
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
More...
 
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 More...
 
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 More...
 
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
More...
 
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
More...
 
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 More...
 
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 More...
 
#define FNV_64_PRIME   ((Fnv1aImplementation::Fnv64_t)0x100000001b3ULL)
 FNV-1a defines the initial basis to be non-zero. More...
 

Detailed Description

Macro Definition Documentation

◆ __FNV_H__

#define __FNV_H__

Include guard from the original fnv.h.

Definition at line 151 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 172 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 221 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 188 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 190 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 241 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 243 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 520 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 156 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 197 of file hash-fnv.cc.

Typedef Documentation

◆ Fnv32_t

32 bit FNV-0 hash type

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

◆ Fnv64_t

64 bit FNV-0 hash

Definition at line 205 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 256 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 379 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 418 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 542 of file hash-fnv.cc.

References FNV_64_PRIME, and visualizer.core::long.

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 647 of file hash-fnv.cc.

References FNV_64_PRIME, and visualizer.core::long.