mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-22 18:58:21 +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;
|
|
}
|