CBMC
Loading...
Searching...
No Matches
string_hash.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: string hashing
4
5
Author: Daniel Kroening, kroening@kroening.com
6
7
\*******************************************************************/
8
11
12
#include "
string_hash.h
"
13
14
std::size_t
hash_string
(std::string_view s)
15
{
16
return
hash_string
(s.data(), s.size());
17
}
18
19
std::size_t
hash_string
(
const
char
*s, std::size_t
len
)
20
{
21
std::size_t
h
= 0;
22
23
for
(;
len
!= 0; --
len
, ++s)
24
h
= (
h
<< 5) -
h
+ *s;
25
26
return
h
;
27
}
ait
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition
ai.h:566
hash_string
std::size_t hash_string(std::string_view s)
Definition
string_hash.cpp:14
string_hash.h
string hashing
src
util
string_hash.cpp
Generated by
1.9.8