2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

C# Unity 向け XXHash32 (XXH32) 最小実装

Posted at

リファレンス実装を分かりやすくしたもの、として本家から紹介されていたこちらをそのまま C# / Unity で動くようにしたものです。

UTF8 のバイト列を C# 文字列(UTF16)に変換して辞書のキーにするよりは、XXH32 ハッシュ値をキーにしたほうがいいんじゃないかなー。とかそういう用途です。

xxHash 早見表

  • XXH32 : generates 32-bit hashes, using 32-bit arithmetic
  • XXH64 : generates 64-bit hashes, using 64-bit arithmetic
  • XXH3 (since v0.8.0): generates 64 or 128-bit hashes, using vectorized arithmetic. The 128-bit variant is called XXH128.

つかいかた

internal な静的クラスが1ファイルに入っているので、何かしらのアセンブリにコピーして、

var hash = MinXXHash32.XXH32(byteArray, byteArray.Length, seed);

です。

Gist

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?