StronglyUniversalStringHashing
StronglyUniversalStringHashing copied to clipboard
Word Padding could be improved
This is clever code that could be put to good use:
char * s =... // null terminated string
uint64_t c = *( uint64_t *) (s);
uint64_t zero_mask = (c - 0x0101010101010101) & ~c & 0x8080808080808080;
uint64_t string_mask = zero_mask ^ (zero_mask - 1);
c &= string_mask;
credit: Kendall Willets.