Template for creating a Hash::Implementation from a 32-bit hash function. More...
#include "hash-function.h"
Public Member Functions | |
Hash32 (Hash32Function_ptr hp) | |
Constructor from a 32-bit hash function pointer. More... | |
void | clear () override |
Restore initial state. More... | |
uint32_t | GetHash32 (const char *buffer, const std::size_t size) override |
Compute 32-bit hash of a byte buffer. More... | |
Public Member Functions inherited from ns3::Hash::Implementation | |
Implementation () | |
Constructor. More... | |
virtual | ~Implementation () |
Destructor. More... | |
virtual uint64_t | GetHash64 (const char *buffer, const std::size_t size) |
Compute 64-bit hash of a byte buffer. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Implementation > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Private Attributes | |
Hash32Function_ptr | m_fp |
The hash function. More... | |
Template for creating a Hash::Implementation from a 32-bit hash function.
Definition at line 136 of file hash-function.h.
|
inline |
Constructor from a 32-bit hash function pointer.
[in] | hp | Function pointer to a 32-bit hash function. |
Definition at line 144 of file hash-function.h.
|
inlineoverridevirtual |
Restore initial state.
Implements ns3::Hash::Implementation.
Definition at line 154 of file hash-function.h.
|
inlineoverridevirtual |
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. |
Implements ns3::Hash::Implementation.
Definition at line 149 of file hash-function.h.
References m_fp.
|
private |