#include "utility/assert.h"
#include <algorithm>
#include <array>
#include <bit>
#include <concepts>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <span>
Go to the source code of this file.
|
|
constexpr std::size_t | ultra::internal::murmurhash3_block_size {16} |
- Copyright
- Copyright (C) 2024 EOS di Manlio Morini.
- License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/
◆ finalize()
| void ultra::internal::finalize |
( |
hash_t & | h, |
|
|
std::size_t | total_len ) |
|
inlinenoexcept |
Finalises the hash state after all input has been processed.
- Parameters
-
| [in,out] | h | current hash state |
| [in] | total_len | total length of the input, in bytes |
This step incorporates the message length and applies the final avalanche mixing to produce the final 128-bit hash value.
◆ process_block()
| void ultra::internal::process_block |
( |
hash_t & | h, |
|
|
std::uint64_t | k1, |
|
|
std::uint64_t | k2 ) |
|
inlinenoexcept |
Mixes a single 128-bit block into the hash state.
- Parameters
-
| [in,out] | h | current hash state |
| [in] | k1 | first 64-bit block |
| [in] | k2 | second 64-bit block |
This function corresponds to the body mixing step of the MurmurHash3 x64 128-bit algorithm.
◆ process_tail()
| void ultra::internal::process_tail |
( |
hash_t & | h, |
|
|
const std::byte * | tail, |
|
|
std::size_t | len ) |
|
inlinenoexcept |
Processes the remaining tail bytes (0–15) of the input.
- Parameters
-
| [in,out] | h | current hash state |
| [in] | tail | pointer to the remaining bytes |
| [in] | len | number of valid bytes in tail |
This implements the exact tail-handling logic defined by the MurmurHash3 x64 128-bit reference implementation.