* aFnv
-(by [[K]], 2024.09.09)

** (1) ver.1.00 [2024.09.09] (?行)
** (1) ver.1.00 [2024.09.09] (19行)
 AStatic uint32_t aFnv32(const void *p, AInt l)
 {
     const unsigned char *q = (const unsigned char *) p;
     uint32_t h = 0x811c9dc5;
     AInt i;
     for (i = 0; i < l; i++)
         h = (h * 0x01000193) ^ q[i];
     return h;
 }
 
 AStatic uint64_t aFnv64(const void *p, AInt l)
 {
     const unsigned char *q = (const unsigned char *) p;
     uint64_t h = 0xcbf29ce484222325ULL;
     AInt i;
     for (i = 0; i < l; i++)
         h = (h * 0x00000100000001b3ULL) ^ q[i];
     return h;
 }
-https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function に書かれたアルゴリズムを実装したもの。

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS