A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
hash-murmur3.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2012 Lawrence Livermore National Laboratory
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
19
*/
20
21
#ifndef HASH_MURMUR3_H
22
#define HASH_MURMUR3_H
23
24
#include "
hash-function.h
"
25
32
namespace
ns3
{
33
34
namespace
Hash {
35
36
namespace
Function {
37
53
class
Murmur3
:
public
Implementation
54
{
55
public
:
59
Murmur3
();
74
uint32_t
GetHash32
(
const
char
* buffer,
const
std::size_t size);
89
uint64_t
GetHash64
(
const
char
* buffer,
const
std::size_t size);
93
virtual
void
clear
(
void
);
94
95
private
:
102
enum
seed
103
{
104
SEED
= 0x8BADF00D
// Ate bad food
105
};
111
uint32_t
m_hash32
;
112
std::size_t
m_size32
;
117
uint64_t
m_hash64
[2];
118
std::size_t
m_size64
;
121
};
// class Murmur3
122
123
}
// namespace Function
124
125
}
// namespace Hash
126
127
}
// namespace ns3
128
129
#endif
/* HASH_MURMUR3_H */
ns3::Hash::Function::Murmur3
Murmur3 hash function implementation.
Definition:
hash-murmur3.h:54
ns3::Hash::Function::Murmur3::Murmur3
Murmur3()
Constructor, clears internal state.
Definition:
hash-murmur3.cc:522
ns3::Hash::Function::Murmur3::clear
virtual void clear(void)
Restore initial state.
Definition:
hash-murmur3.cc:572
ns3::Hash::Function::Murmur3::m_size32
std::size_t m_size32
Cache last hash value, and total bytes hashed (needed to finalize), for incremental hashing.
Definition:
hash-murmur3.h:112
ns3::Hash::Function::Murmur3::m_hash64
uint64_t m_hash64[2]
murmur3 produces 128-bit hash and state; we use just the first 64-bits.
Definition:
hash-murmur3.h:117
ns3::Hash::Function::Murmur3::seed
seed
Seed value.
Definition:
hash-murmur3.h:103
ns3::Hash::Function::Murmur3::SEED
@ SEED
Definition:
hash-murmur3.h:104
ns3::Hash::Function::Murmur3::m_hash32
uint32_t m_hash32
Cache last hash value, and total bytes hashed (needed to finalize), for incremental hashing.
Definition:
hash-murmur3.h:111
ns3::Hash::Function::Murmur3::GetHash32
uint32_t GetHash32(const char *buffer, const std::size_t size)
Compute 32-bit hash of a byte buffer.
Definition:
hash-murmur3.cc:528
ns3::Hash::Function::Murmur3::GetHash64
uint64_t GetHash64(const char *buffer, const std::size_t size)
Compute 64-bit hash of a byte buffer.
Definition:
hash-murmur3.cc:542
ns3::Hash::Function::Murmur3::m_size64
std::size_t m_size64
murmur3 produces 128-bit hash and state; we use just the first 64-bits.
Definition:
hash-murmur3.h:118
ns3::Hash::Implementation
Hash function implementation base class.
Definition:
hash-function.h:48
hash-function.h
ns3::Hash::Implementation, ns3::Hash::Function::Hash32 and ns3::Hash::Function::Hash64 declarations.
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
model
hash-murmur3.h
Generated on Tue Feb 6 2024 19:21:16 for ns-3 by
1.9.1