#format text_markdown ハッシュ関数メモ ================ APR の apr_hash で使われているハッシュ関数。要点だけ抜き出した。 ```c static unsigned int hashfunc(const char *k, size_t len) { const unsigned char *key = (const unsigned char *)k; const unsigned char *p; unsigned int hash = 0; for (p = key; len; len--, p++) { hash = hash * 33 + *p; } return hash; } ``` 参考 ---- [Chi^2 test について](http://burtleburtle.net/bob/hash/hashfaq.html) [FNV Hash - 分散と速度測定](http://www.radiumsoftware.com/0605.html#060526)