xref: /netbsd-src/external/gpl3/gcc/dist/libstdc++-v3/libsupc++/hash_bytes.h (revision b1e838363e3c6fc78a55519254d99869742dd33c)
148fb7bfaSmrg // Declarations for hash functions. -*- C++ -*-
248fb7bfaSmrg 
3*b1e83836Smrg // Copyright (C) 2010-2022 Free Software Foundation, Inc.
448fb7bfaSmrg //
548fb7bfaSmrg // This file is part of the GNU ISO C++ Library.  This library is free
648fb7bfaSmrg // software; you can redistribute it and/or modify it under the
748fb7bfaSmrg // terms of the GNU General Public License as published by the
848fb7bfaSmrg // Free Software Foundation; either version 3, or (at your option)
948fb7bfaSmrg // any later version.
1048fb7bfaSmrg 
1148fb7bfaSmrg // This library is distributed in the hope that it will be useful,
1248fb7bfaSmrg // but WITHOUT ANY WARRANTY; without even the implied warranty of
1348fb7bfaSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1448fb7bfaSmrg // GNU General Public License for more details.
1548fb7bfaSmrg 
1648fb7bfaSmrg // Under Section 7 of GPL version 3, you are granted additional
1748fb7bfaSmrg // permissions described in the GCC Runtime Library Exception, version
1848fb7bfaSmrg // 3.1, as published by the Free Software Foundation.
1948fb7bfaSmrg 
2048fb7bfaSmrg // You should have received a copy of the GNU General Public License and
2148fb7bfaSmrg // a copy of the GCC Runtime Library Exception along with this program;
2248fb7bfaSmrg // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2348fb7bfaSmrg // <http://www.gnu.org/licenses/>.
2448fb7bfaSmrg 
2548fb7bfaSmrg /** @file bits/hash_bytes.h
2648fb7bfaSmrg  *  This is an internal header file, included by other library headers.
2748fb7bfaSmrg  *  Do not attempt to use it directly. @headername{functional}
2848fb7bfaSmrg  */
2948fb7bfaSmrg 
3048fb7bfaSmrg #ifndef _HASH_BYTES_H
3148fb7bfaSmrg #define _HASH_BYTES_H 1
3248fb7bfaSmrg 
3348fb7bfaSmrg #pragma GCC system_header
3448fb7bfaSmrg 
3548fb7bfaSmrg #include <bits/c++config.h>
3648fb7bfaSmrg 
3748fb7bfaSmrg namespace std
3848fb7bfaSmrg {
3948fb7bfaSmrg _GLIBCXX_BEGIN_NAMESPACE_VERSION
4048fb7bfaSmrg 
4148fb7bfaSmrg   // Hash function implementation for the nontrivial specialization.
4248fb7bfaSmrg   // All of them are based on a primitive that hashes a pointer to a
4348fb7bfaSmrg   // byte array. The actual hash algorithm is not guaranteed to stay
4448fb7bfaSmrg   // the same from release to release -- it may be updated or tuned to
4548fb7bfaSmrg   // improve hash quality or speed.
4648fb7bfaSmrg   size_t
4748fb7bfaSmrg   _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
4848fb7bfaSmrg 
4948fb7bfaSmrg   // A similar hash primitive, using the FNV hash algorithm. This
5048fb7bfaSmrg   // algorithm is guaranteed to stay the same from release to release.
5148fb7bfaSmrg   // (although it might not produce the same values on different
5248fb7bfaSmrg   // machines.)
5348fb7bfaSmrg   size_t
5448fb7bfaSmrg   _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
5548fb7bfaSmrg 
5648fb7bfaSmrg _GLIBCXX_END_NAMESPACE_VERSION
5748fb7bfaSmrg } // namespace
5848fb7bfaSmrg 
5948fb7bfaSmrg #endif
60