|  | 
|  | 
| back to board | A bloom filter with this hash function can pass these test cases, please add more strict cases. char buf[41];
 unsigned hash()
 {
 unsigned h = 0;
 for (char* p = buf; *p; ++p)
 {
 h = h * 13 + *p;
 }
 return h & 511;
 }
 
 Edited by author 22.04.2019 21:30
 | 
 | 
|