Hash function implementation base class. More...
#include <hash-function.h>
Public Member Functions | |
Implementation () | |
virtual | ~Implementation () |
virtual void | clear (void)=0 |
virtual uint32_t | GetHash32 (const char *buffer, const size_t size)=0 |
virtual uint64_t | GetHash64 (const char *buffer, const size_t size) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
Additional Inherited Members | |
![]() | |
static void | Cleanup (void) |
Hash function implementation base class.
Definition at line 40 of file hash-function.h.
|
inline |
Constructor
Definition at line 82 of file hash-function.h.
|
inlinevirtual |
Destructor
Definition at line 86 of file hash-function.h.
|
pure virtual |
Restore initial state
Implemented in ns3::Hash::Function::Hash64, ns3::Hash::Function::Hash32, ns3::Hash::Function::Fnv1a, and ns3::Hash::Function::Murmur3.
Referenced by ns3::Hasher::clear().
|
pure virtual |
Compute 32-bit hash of a byte buffer
Call clear () between calls to GetHash32() to reset the internal state and hash each buffer separately.
If you don't call clear() between calls to GetHash32, you can hash successive buffers. The final return value will be the cumulative hash across all calls.
[in] | buffer | pointer to the beginning of the buffer |
[in] | size | length of the buffer, in bytes |
Implemented in ns3::Hash::Function::Hash64, ns3::Hash::Function::Hash32, ns3::Hash::Function::Fnv1a, and ns3::Hash::Function::Murmur3.
Referenced by ns3::Hasher::GetHash32(), and GetHash64().
|
virtual |
Compute 64-bit hash of a byte buffer.
Default implementation returns 32-bit hash, with a warning.
Call clear () between calls to GetHash64() to reset the internal state and hash each buffer separately.
If you don't call clear() between calls to GetHash64, you can hash successive buffers. The final return value will be the cumulative hash across all calls.
[in] | buffer | pointer to the beginning of the buffer |
[in] | size | length of the buffer, in bytes |
Reimplemented in ns3::Hash::Function::Hash64, ns3::Hash::Function::Fnv1a, and ns3::Hash::Function::Murmur3.
Definition at line 32 of file hash-function.cc.
References GetHash32(), and NS_LOG_WARN.
Referenced by ns3::Hasher::GetHash64().