SMTStabilizer API
Public API documentation for SMTStabilizer
Loading...
Searching...
No Matches
hash.cpp
Go to the documentation of this file.
1/***
2 * Bitwuzla: Satisfiability Modulo Theories (SMT) solver.
3 *
4 * Copyright (C) 2025 by the authors listed in the AUTHORS file at
5 * https://github.com/bitwuzla/bitwuzla/blob/main/AUTHORS
6 *
7 * This file is part of Bitwuzla under the MIT license. See COPYING for more
8 * information at https://github.com/bitwuzla/bitwuzla/blob/main/COPYING
9 */
10// Modified by Xiang Zhang, 2026
11// Additional changes licensed under the MIT License
12#include "util/hash.h"
13
14namespace {
19uint64_t fnv1a_64(uint64_t v, uint64_t hash = 14695981039346656037u) {
20 hash ^= v;
21 // Compute (hash * 1099511628211)
22 return hash + (hash << 1) + (hash << 4) + (hash << 5) + (hash << 7) +
23 (hash << 8) + (hash << 40);
24}
25} // namespace
26
27size_t std::hash<std::pair<uint64_t, uint64_t>>::operator()(
28 const std::pair<uint64_t, uint64_t> &p) const {
29 uint64_t hash = fnv1a_64(std::hash<uint64_t>()(p.first));
30 return static_cast<size_t>(fnv1a_64(std::hash<uint64_t>()(p.second), hash));
31}