Public Types | |
enum | Bits { Bits32, Bits64 } |
Public Member Functions | |
Collider (const std::string name, Hasher hash, const enum Bits bits) | |
bool | Add (const std::string phrase) |
std::string | GetName () const |
void | Report () const |
Public Attributes | |
Hasher | m_hash |
std::string | m_name |
Private Types | |
typedef std::vector< std::pair < uint64_t, std::string > > | collision_t |
typedef std::map< uint64_t, std::string > | hashdict_t |
Private Member Functions | |
uint64_t | GetHash (const std::string phrase) |
Private Attributes | |
enum Bits | m_bits |
collision_t | m_coll |
hashdict_t | m_dict |
Keep track of collisions
Definition at line 45 of file hash-example.cc.
|
private |
Collision map of subsequent instances
Definition at line 183 of file hash-example.cc.
|
private |
Hashed dictionary of first instance of each hash
Definition at line 177 of file hash-example.cc.
Definition at line 51 of file hash-example.cc.
|
inline |
Constructor
Definition at line 63 of file hash-example.cc.
|
inline |
|
inlineprivate |
Get the appropriate hash value
[in] | phrase | the string to hash |
Definition at line 157 of file hash-example.cc.
References Bits32, ns3::Hasher::clear(), ns3::Hasher::GetHash32(), ns3::Hasher::GetHash64(), m_bits, and m_hash.
Referenced by Add().
|
inline |
|
inline |
Print the collisions found
Definition at line 126 of file hash-example.cc.
References GetName(), m_coll, and m_dict.
|
private |
Hash function
Definition at line 174 of file hash-example.cc.
|
private |
The list of collisions
Definition at line 186 of file hash-example.cc.
|
private |
The dictionary map, indexed by hash
Definition at line 180 of file hash-example.cc.
Hasher ns3::Hash::Example::Collider::m_hash |
std::string ns3::Hash::Example::Collider::m_name |