HIBF 1.0.0-rc.1
Loading...
Searching...
No Matches
wyhash.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2026, Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2026, Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
9#pragma once
10
11#include <cstdint> // for uint64_t
12
13#include <hibf/platform.hpp>
14
15namespace seqan::hibf::sketch
16{
17
29[[nodiscard]] constexpr uint64_t wyhash(uint64_t const value) noexcept
30{
31 __uint128_t result = value;
32 result *= 0x9E3779B97F4A7C15ULL;
33 return static_cast<uint64_t>(result) ^ static_cast<uint64_t>(result >> 64);
34}
35
36} // namespace seqan::hibf::sketch
constexpr uint64_t wyhash(uint64_t const value) noexcept
Mixes the bits of value: the 128-bit product with a 64-bit constant, folded to 64 bits via XOR.
Definition wyhash.hpp:29
Provides platform and dependency checks.