| // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "base/base_export.h" |
| #include "base/basictypes.h" |
| // From http://www.azillionmonkeys.com/qed/hash.html |
| // This is the hash used on WebCore/platform/stringhash |
| BASE_EXPORT uint32 SuperFastHash(const char * data, int len); |
| inline uint32 Hash(const char* key, size_t length) { |
| return SuperFastHash(key, static_cast<int>(length)); |
| inline uint32 Hash(const std::string& key) { |
| return SuperFastHash(key.data(), static_cast<int>(key.size())); |