mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
docs + vartype fix
This commit is contained in:
parent
af6a87235a
commit
d6dc6df33d
@ -13,12 +13,12 @@
|
|||||||
* @brief SDBM algorithm implementation
|
* @brief SDBM algorithm implementation
|
||||||
*
|
*
|
||||||
* @param s NULL terminated string to hash
|
* @param s NULL terminated string to hash
|
||||||
* @return 64-bit
|
* @return 64-bit hash result
|
||||||
*/
|
*/
|
||||||
uint64_t sdbm(const char* s)
|
uint64_t sdbm(const char* s)
|
||||||
{
|
{
|
||||||
uint64_t hash = 0;
|
uint64_t hash = 0;
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
while (s[i] != '\0')
|
while (s[i] != '\0')
|
||||||
{
|
{
|
||||||
hash = s[i] + (hash << 6) + (hash << 16) - hash;
|
hash = s[i] + (hash << 6) + (hash << 16) - hash;
|
||||||
|
Loading…
Reference in New Issue
Block a user