Git - code.swisschili.sh
code.swisschili.sh
/
6502
/
a4f49b5a14bf5e119a66633813deab5f594ee239
/
.
/
as
/
hash.c
blob: df4fec070f80bb293f0517a4acbe66367d538e3d [
file
] [
log
] [
blame
]
swissChili
ca0d2e2
2020-08-16 15:09:25 -0700
[
diff
] [
blame
]
1
#include
"hash.h"
2
3
uint32_t
hash
(
char
*
str
)
4
{
5
uint32_t
hash
=
5381
;
6
char
c
;
7
8
while
(
c
=
*
str
++)
9
{
10
hash
=
(
hash
<<
5
)
+
hash
+
c
;
11
}
12
13
return
hash
;
14
}