11debfc3dSmrg // Declarations for hash functions. -*- C++ -*- 21debfc3dSmrg 3*8feb0f0bSmrg // Copyright (C) 2010-2020 Free Software Foundation, Inc. 41debfc3dSmrg // 51debfc3dSmrg // This file is part of the GNU ISO C++ Library. This library is free 61debfc3dSmrg // software; you can redistribute it and/or modify it under the 71debfc3dSmrg // terms of the GNU General Public License as published by the 81debfc3dSmrg // Free Software Foundation; either version 3, or (at your option) 91debfc3dSmrg // any later version. 101debfc3dSmrg 111debfc3dSmrg // This library is distributed in the hope that it will be useful, 121debfc3dSmrg // but WITHOUT ANY WARRANTY; without even the implied warranty of 131debfc3dSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 141debfc3dSmrg // GNU General Public License for more details. 151debfc3dSmrg 161debfc3dSmrg // Under Section 7 of GPL version 3, you are granted additional 171debfc3dSmrg // permissions described in the GCC Runtime Library Exception, version 181debfc3dSmrg // 3.1, as published by the Free Software Foundation. 191debfc3dSmrg 201debfc3dSmrg // You should have received a copy of the GNU General Public License and 211debfc3dSmrg // a copy of the GCC Runtime Library Exception along with this program; 221debfc3dSmrg // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 231debfc3dSmrg // <http://www.gnu.org/licenses/>. 241debfc3dSmrg 251debfc3dSmrg /** @file bits/hash_bytes.h 261debfc3dSmrg * This is an internal header file, included by other library headers. 271debfc3dSmrg * Do not attempt to use it directly. @headername{functional} 281debfc3dSmrg */ 291debfc3dSmrg 301debfc3dSmrg #ifndef _HASH_BYTES_H 311debfc3dSmrg #define _HASH_BYTES_H 1 321debfc3dSmrg 331debfc3dSmrg #pragma GCC system_header 341debfc3dSmrg 351debfc3dSmrg #include <bits/c++config.h> 361debfc3dSmrg 371debfc3dSmrg namespace std 381debfc3dSmrg { 391debfc3dSmrg _GLIBCXX_BEGIN_NAMESPACE_VERSION 401debfc3dSmrg 411debfc3dSmrg // Hash function implementation for the nontrivial specialization. 421debfc3dSmrg // All of them are based on a primitive that hashes a pointer to a 431debfc3dSmrg // byte array. The actual hash algorithm is not guaranteed to stay 441debfc3dSmrg // the same from release to release -- it may be updated or tuned to 451debfc3dSmrg // improve hash quality or speed. 461debfc3dSmrg size_t 471debfc3dSmrg _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); 481debfc3dSmrg 491debfc3dSmrg // A similar hash primitive, using the FNV hash algorithm. This 501debfc3dSmrg // algorithm is guaranteed to stay the same from release to release. 511debfc3dSmrg // (although it might not produce the same values on different 521debfc3dSmrg // machines.) 531debfc3dSmrg size_t 541debfc3dSmrg _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); 551debfc3dSmrg 561debfc3dSmrg _GLIBCXX_END_NAMESPACE_VERSION 571debfc3dSmrg } // namespace 581debfc3dSmrg 591debfc3dSmrg #endif 60