今日はリンクリストとハッシュ関数 (xorshiftにしてみた) を書いた上でリサイズ・リハッシュに対応したハッシュテーブルをほぼ実装した。実装したので、あとはテストするだけだな、というフラグ
=> More informations about this toot | More toots from tadd@best-friends.chat
ていうか真面目に分かってないんですが、xorshiftってうまくバラけるハッシュ関数として使っていいの?
バラけるハッシュ関数をファイルとかが同じか見るのに使っちゃダメ、逆は遅いがまぁよい(Rustがやってる)、は分かるけど、乱数とかはどうなるんだろう
=> More informations about this toot | More toots from tadd@best-friends.chat
正確にはxorshiftは、前回返した乱数(状態として記憶)から次の乱数を返す関数らしい。この連鎖を俯瞰すると次の数がとても予測しづらい(ばらばら)、だから乱数ということになるんだろうけど、ハッシュ関数としてなら連鎖は起こらないので、なんか違うのかも知れない
=> More informations about this toot | More toots from tadd@best-friends.chat
あっ、はい、やはりか https://news.ycombinator.com/item?id=29252921
=> More informations about this toot | More toots from tadd@best-friends.chat
@tadd https://github.com/rurban/smhasher
=> More informations about this toot | More toots from omasanori@mstdn.maud.io
@omasanori おお、情報ありがとうございます。何も知らなかったのでありがたいです。
なのですが、これは一体なんの表なのでしょうか?並んでるアルゴリズムも、いわゆる暗号学的なやつとそうでないのがごっちゃで、何を見るための表なのかがいまいち分かってないです。
=> More informations about this toot | More toots from tadd@best-friends.chat
@omasanori うーんごめんなさい、読み進めてもいまいち分からなかったんで質問させてください。
速度は分かるのですが、品質(分布)を表す指標は表のどれなのでしょうか?
この文章やハッシュ関数における「サイクル」というのが自分は分かっていなくて、それが入った2つの列の理解もあやふやです。
=> More informations about this toot | More toots from tadd@best-friends.chat
@tadd サイクルは(x86-64での)クロックサイクルのことです。品質についてはquality problemsに通過しなかったテストについて書かれていますが、定量的な指標は載っていません。rurban版については、表そのものというよりはその下の文章が参考になるかなと思います。
=> More informations about this toot | More toots from omasanori@mstdn.maud.io
@omasanori クロックサイクル、なるほど!理解しました。品質についても、もともと数字はないんですね。下の方ももっかい読んでみます、ありがとうございます。
=> More informations about this toot | More toots from tadd@best-friends.chat This content has been proxied by September (3851b).Proxy Information
text/gemini