mirror of
https://github.com/libretro/RetroArch
synced 2024-12-29 12:31:05 +00:00
13 lines
252 B
C
13 lines
252 B
C
|
#include "hash.h"
|
||
|
|
||
|
uint32_t cheevos_djb2(const char* str, size_t length)
|
||
|
{
|
||
|
const unsigned char* aux = (const unsigned char*)str;
|
||
|
uint32_t hash = 5381;
|
||
|
|
||
|
while (length--)
|
||
|
hash = ( hash << 5 ) + hash + *aux++;
|
||
|
|
||
|
return hash;
|
||
|
}
|