49namespace Murmur3Implementation
90 return (x << r) | (x >> (32 - r));
102 return (x << r) | (x >> (64 - r));
106#define BIG_CONSTANT(x) (x##LLU)
124inline uint64_t
getblock (
const uint64_t * p, std::size_t
i )
196 const uint8_t *
data = (
const uint8_t*)key;
221 h1 =
h1*5+0xe6546b64;
233 case 3:
k1 ^=
tail[2] << 16;
234 case 2:
k1 ^=
tail[1] << 8;
303 const uint8_t *
data = (
const uint8_t*)key;
359 case 15:
k4 ^=
tail[14] << 16;
360 case 14:
k4 ^=
tail[13] << 8;
361 case 13:
k4 ^=
tail[12] << 0;
364 case 12:
k3 ^=
tail[11] << 24;
365 case 11:
k3 ^=
tail[10] << 16;
366 case 10:
k3 ^=
tail[ 9] << 8;
367 case 9:
k3 ^=
tail[ 8] << 0;
370 case 8:
k2 ^=
tail[ 7] << 24;
371 case 7:
k2 ^=
tail[ 6] << 16;
372 case 6:
k2 ^=
tail[ 5] << 8;
373 case 5:
k2 ^=
tail[ 4] << 0;
376 case 4:
k1 ^=
tail[ 3] << 24;
377 case 3:
k1 ^=
tail[ 2] << 16;
378 case 2:
k1 ^=
tail[ 1] << 8;
379 case 1:
k1 ^=
tail[ 0] << 0;
425 const uint8_t *
data = (
const uint8_t*)key;
437 const uint64_t *
blocks = (
const uint64_t *)(
data);
463 case 15:
k2 ^= uint64_t(
tail[14]) << 48;
464 case 14:
k2 ^= uint64_t(
tail[13]) << 40;
465 case 13:
k2 ^= uint64_t(
tail[12]) << 32;
466 case 12:
k2 ^= uint64_t(
tail[11]) << 24;
467 case 11:
k2 ^= uint64_t(
tail[10]) << 16;
468 case 10:
k2 ^= uint64_t(
tail[ 9]) << 8;
469 case 9:
k2 ^= uint64_t(
tail[ 8]) << 0;
472 case 8:
k1 ^= uint64_t(
tail[ 7]) << 56;
473 case 7:
k1 ^= uint64_t(
tail[ 6]) << 48;
474 case 6:
k1 ^= uint64_t(
tail[ 5]) << 40;
475 case 5:
k1 ^= uint64_t(
tail[ 4]) << 32;
476 case 4:
k1 ^= uint64_t(
tail[ 3]) << 24;
477 case 3:
k1 ^= uint64_t(
tail[ 2]) << 16;
478 case 2:
k1 ^= uint64_t(
tail[ 1]) << 8;
479 case 1:
k1 ^= uint64_t(
tail[ 0]) << 0;
520 using namespace Murmur3Implementation;
533 using namespace Murmur3Implementation;
553 uint64_t result = hash[1];
554 result = (result << 32) | hash[0];
void clear() override
Restore initial state.
Murmur3()
Constructor, clears internal state.
std::size_t m_size32
Cache last hash value, and total bytes hashed (needed to finalize), for incremental hashing.
uint64_t m_hash64[2]
murmur3 produces 128-bit hash and state; we use just the first 64-bits.
uint32_t GetHash32(const char *buffer, const std::size_t size) override
Compute 32-bit hash of a byte buffer.
uint32_t m_hash32
Cache last hash value, and total bytes hashed (needed to finalize), for incremental hashing.
static constexpr auto SEED
Seed value.
uint64_t GetHash64(const char *buffer, const std::size_t size) override
Compute 64-bit hash of a byte buffer.
std::size_t m_size64
murmur3 produces 128-bit hash and state; we use just the first 64-bits.
void MurmurHash3_x86_128_fin(const std::size_t len, uint32_t *seeds, void *out)
Finalize a hash.
void MurmurHash3_x86_128_incr(const void *key, const std::size_t len, uint32_t *seeds, void *out)
Initial and incremental hash.
uint32_t getblock(const uint32_t *p, std::size_t i)
Block read.
uint64_t rotl64(uint64_t x, int8_t r)
Barrel shift (rotate) left on 64 bits.
uint32_t fmix(uint32_t h)
Finalization mix - force all bits of a hash block to avalanche.
uint32_t rotl32(uint32_t x, int8_t r)
Barrel shift (rotate) left on 32 bits.
void MurmurHash3_x64_128(const void *key, const std::size_t len, const uint32_t seed, void *out)
Initial and incremental hash.
void MurmurHash3_x86_32(const void *key, std::size_t len, uint32_t seed, void *out)
Initial and incremental hash.
void MurmurHash3_x86_128(const void *key, const std::size_t len, uint32_t seed, void *out)
Initial and incremental hash.
void MurmurHash3_x86_32_fin(std::size_t len, uint32_t seed, void *out)
Finalize a hash.
void MurmurHash3_x86_32_incr(const void *key, std::size_t len, uint32_t seed, void *out)
Initial and incremental hash.
#define BIG_CONSTANT(x)
Unsigned long long constants.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
ns3::Hash::Function::Murmur3 declaration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.