Answer the question
In order to leave comments, you need to log in
Why is there a shift to the left (hash)?
Hello! Below is a construction for building a hash from a string, it is not clear to me why a shift is needed:
int hash = 0;
char* string = "abc";
const char* pchar = string;
while(*pchar){
hash <<= 1;
hash ^= *pchar++;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question