repo.or.cz
/
dasher.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
tagging release
[dasher.git]
/
Src
/
Common
/
Hash.h
blob
d3b79ba7a4cbc25b1cf9df231c3146fe5748e86f
1
// Hash.h
2
//
3
// Copyright (c) 2005 David Ward
4
5
#ifndef __Common_Hash_h__
6
#define __Common_Hash_h__
7
8
// String hash function
9
10
inline
size_t
hash_string
(
const char
*
s
) {
11
register
size_t
i
;
12
for
(
i
=
0
; *
s
;
s
++) {
13
i
*=
16777619
;
14
i
^= *
s
;
15
}
16
return
i
;
17
18
}
19
20
#endif