1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_HASH_H_ 6 #define BASE_HASH_H_ 7 8 #include <cstdint> 9 #include <functional> 10 #include <string> 11 12 namespace base { 13 14 // Deprecated: just use std::hash directly 15 // 16 // Computes a hash of a string |str|. 17 // WARNING: This hash function should not be used for any cryptographic purpose. 18 inline uint32_t Hash(const std::string& str) { 19 std::hash<std::string> hash_fn; 20 return hash_fn(str); 21 } 22 23 } // namespace base 24 25 #endif // BASE_HASH_H_ 26