A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
hash-function.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Lawrence Livermore National Laboratory
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
7 */
8
9#include "hash-function.h"
10
11#include "log.h"
12
13/**
14 * \file
15 * \ingroup hash
16 * \brief ns3::Hash::Implementation::GetHash64 default implementation.
17 */
18
19namespace ns3
20{
21
22NS_LOG_COMPONENT_DEFINE("HashFunction");
23
24namespace Hash
25{
26
27uint64_t
28Implementation::GetHash64(const char* buffer, const std::size_t size)
29{
30 NS_LOG_WARN("64-bit hash requested, only 32-bit implementation available");
31 return GetHash32(buffer, size);
32}
33
34} // namespace Hash
35
36} // namespace ns3
virtual uint64_t GetHash64(const char *buffer, const std::size_t size)
Compute 64-bit hash of a byte buffer.
virtual uint32_t GetHash32(const char *buffer, const std::size_t size)=0
Compute 32-bit hash of a byte buffer.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition log.h:250
ns3::Hash::Implementation, ns3::Hash::Function::Hash32 and ns3::Hash::Function::Hash64 declarations.
Debug message logging.
Every class exported by the ns3 library is enclosed in the ns3 namespace.