about summary refs log tree commit diff
path: root/absl/hash/internal/hash.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/hash/internal/hash.cc')
-rw-r--r--absl/hash/internal/hash.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/absl/hash/internal/hash.cc b/absl/hash/internal/hash.cc
index 4ab7a9f8bfd9..c17f3be1719a 100644
--- a/absl/hash/internal/hash.cc
+++ b/absl/hash/internal/hash.cc
@@ -17,6 +17,36 @@
 namespace absl {
 namespace hash_internal {
 
+uint64_t CityHashState::CombineLargeContiguousImpl32(uint64_t state,
+                                                     const unsigned char* first,
+                                                     size_t len) {
+  while (len >= PiecewiseChunkSize()) {
+    state =
+        Mix(state, absl::hash_internal::CityHash32(reinterpret_cast<const char*>(first),
+                                         PiecewiseChunkSize()));
+    len -= PiecewiseChunkSize();
+    first += PiecewiseChunkSize();
+  }
+  // Handle the remainder.
+  return CombineContiguousImpl(state, first, len,
+                               std::integral_constant<int, 4>{});
+}
+
+uint64_t CityHashState::CombineLargeContiguousImpl64(uint64_t state,
+                                                     const unsigned char* first,
+                                                     size_t len) {
+  while (len >= PiecewiseChunkSize()) {
+    state =
+        Mix(state, absl::hash_internal::CityHash64(reinterpret_cast<const char*>(first),
+                                         PiecewiseChunkSize()));
+    len -= PiecewiseChunkSize();
+    first += PiecewiseChunkSize();
+  }
+  // Handle the remainder.
+  return CombineContiguousImpl(state, first, len,
+                               std::integral_constant<int, 8>{});
+}
+
 ABSL_CONST_INIT const void* const CityHashState::kSeed = &kSeed;
 
 }  // namespace hash_internal