A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
hash-fnv.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_FNV_H
22
#define HASH_FNV_H
23
24
#include "
hash-function.h
"
25
26
namespace
ns3 {
27
28
namespace
Hash {
29
30
namespace
Function {
31
47
class
Fnv1a
:
public
Implementation
48
{
49
public
:
53
Fnv1a
();
68
uint32_t
GetHash32
(
const
char
* buffer,
const
size_t
size);
83
uint64_t
GetHash64
(
const
char
* buffer,
const
size_t
size);
87
virtual
void
clear
(
void
);
88
89
private
:
93
enum
seed
94
{
95
SEED
= 0x8BADF00D
// Ate bad food
96
};
98
101
uint32_t
m_hash32
;
102
uint64_t
m_hash64
;
104
105
};
// class Fnv1a
106
107
}
// namespace Function
108
109
}
// namespace Hash
110
111
}
// namespace ns3
112
113
#endif
/* HASH_FNV_H */
hash-function.h
ns3::Hash::Implementation
Hash function implementation base class.
Definition:
hash-function.h:40
ns3::Hash::Function::Fnv1a::SEED
Definition:
hash-fnv.h:95
ns3::Hash::Function::Fnv1a::m_hash32
uint32_t m_hash32
Cache last hash value, for incremental hashing.
Definition:
hash-fnv.h:101
ns3::Hash::Function::Fnv1a::GetHash64
uint64_t GetHash64(const char *buffer, const size_t size)
Compute 64-bit hash of a byte buffer.
Definition:
hash-fnv.cc:747
ns3::Hash::Function::Fnv1a
Fnv1a hash function implementation.
Definition:
hash-fnv.h:47
ns3::Hash::Function::Fnv1a::GetHash32
uint32_t GetHash32(const char *buffer, const size_t size)
Compute 32-bit hash of a byte buffer.
Definition:
hash-fnv.cc:739
ns3::Hash::Function::Fnv1a::clear
virtual void clear(void)
Restore initial state.
Definition:
hash-fnv.cc:755
ns3::Hash::Function::Fnv1a::m_hash64
uint64_t m_hash64
Cache last hash value, for incremental hashing.
Definition:
hash-fnv.h:102
ns3::Hash::Function::Fnv1a::Fnv1a
Fnv1a()
Constructor.
Definition:
hash-fnv.cc:733
ns3::Hash::Function::Fnv1a::seed
seed
Seed value.
Definition:
hash-fnv.h:93
src
core
model
hash-fnv.h
Generated on Sat Apr 19 2014 14:06:51 for ns-3 by
1.8.6