1 //===-- sanitizer_common.h --------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file implements a simple hash function.
10 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_HASH_H
13 #define SANITIZER_HASH_H
15 #include "sanitizer_internal_defs.h"
17 namespace __sanitizer {
18 class MurMur2HashBuilder {
19 static const u32 m = 0x5bd1e995;
20 static const u32 seed = 0x9747b28c;
21 static const u32 r = 24;
25 explicit MurMur2HashBuilder(u32 init = 0) { h = seed ^ init; }
41 } //namespace __sanitizer
43 #endif // SANITIZER_HASH_H