• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/hash/legacy_hash.h"
6 
7 #include <cstdint>
8 
9 #include "base/containers/span.h"
10 #include "base/third_party/cityhash_v103/src/city_v103.h"
11 
12 namespace base {
13 namespace legacy {
14 
CityHash64(base::span<const uint8_t> data)15 uint64_t CityHash64(base::span<const uint8_t> data) {
16   return internal::cityhash_v103::CityHash64(
17       reinterpret_cast<const char*>(data.data()), data.size());
18 }
19 
CityHash64WithSeed(base::span<const uint8_t> data,uint64_t seed)20 uint64_t CityHash64WithSeed(base::span<const uint8_t> data, uint64_t seed) {
21   return internal::cityhash_v103::CityHash64WithSeed(
22       reinterpret_cast<const char*>(data.data()), data.size(), seed);
23 }
24 
25 }  // namespace legacy
26 }  // namespace base
27