In Dan Bernstein's famous Djb2 hash function I see it's preferred to use the bitwise operator, but why use it over a simple multiplication ? Is it faster ?
(hash << 5) + hash = hash * 33
// Hashes word to a number
unsigned int hash(const char *word)
{
// Djb2 hash function by Dan Bernstein
unsigned long hash = 5381;
int c;
while ((c = *word++))
{
hash = ((hash << 5) + hash) + tolower(c); /* hash * 33 + c */
}
return hash % N;
}