谁能告诉我为什么数字5381用于DJB哈希函数?DJB哈希函数中5381数字的原因是什么?
DJB哈希函数是
H(0)= 5381
H(1)= 33 * H(I-1)^ STR [1]
一个C程序:
unsigned int DJBHash(char* str, unsigned int len)
{
unsigned int hash = 5381;
unsigned int i = 0;
for(i = 0; i < len; str++, i++)
{
hash = ((hash << 5) + hash) + (*str);
}
return hash;
}
那些交换过的网址让我大笑起来。 –
@高我很高兴你的幽默:)幸运的是,交换URLs非常简单,因为我只需要切换数字。 –
我无法理解上述幽默。 –