mirror of
https://github.com/libretro/RetroArch
synced 2025-01-17 19:14:56 +00:00
13 lines
232 B
C
13 lines
232 B
C
|
unsigned djb2( const char* str, unsigned len )
|
||
|
{
|
||
|
const unsigned char* aux = (const unsigned char*)str;
|
||
|
unsigned hash = 5381;
|
||
|
|
||
|
while ( len-- )
|
||
|
{
|
||
|
hash = ( hash << 5 ) + hash + *aux++;
|
||
|
}
|
||
|
|
||
|
return hash;
|
||
|
}
|