Open Roo4L opened 1 year ago
If you look at the comment a few lines above the line you linked, there's a link to a page that explains the choice:
another version of this algorithm (now favored by bernstein) uses xor: hash(i) = hash(i - 1) * 33 ^ str[i];
I don't know what difference it makes, I'm not a hash algorithm researcher. I suppose you could ask DJB, since it's his algorithm...
Hi! I've noticed that
strhash_seeded_djb2
uses^ c
instead of+ c
as most of djb2 implementation do. Could you explain this choice, please? https://github.com/cyrusimap/cyrus-imapd/blob/c615862e7e862a3ff684edc38d8131c345e1cd36/lib/strhash.c#L53