4
4

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.

超高速ハッシュアルゴリズム「xxHash」を試してみた。

Last updated at Posted at 2020-10-19

ファイルの整合性を取る時、MD5とかでハッシュを取って確認する事が多いのですが、高速と噂のハッシュアルゴリズム「xxHash」がどれくらい早いのか検証してみた。

windows

MD5

だいたい250MB/sからたまに270MB/sになるくらい。コマンドは以下

>certutil -hashfile filename.mp4 MD5

md5.png

xxHash

430MB/s ~ 450MB/sくらい。下記からxxhsum_win64_0_7_2_avx2.zipをダウンロードして使用しました。
https://github.com/Cyan4973/xxHash/releases/tag/v0.7.2

>xxhash.exe filename.mp4

xxhas.png

macOS

同じ検証をmacOS(Macbook Pro)でも検証してみた所、1.24GB/sというとんでもない速度を叩き出しました。やはりストレージ速度が早いとかなり効いてきます。ちなみにMD5は400MB/sくらいでした。

まとめ

ある程度スピードの出るストレージであれば効果的である事が分かりました。
ちなみに検証したストレージはSSDで、読みで500MB/sくらい出ます。

注意点としてxxHashは暗号化を行っていないので、セキュリティ目的には使ってはいけません。
今回のケースのようなファイルの整合性を取る処理には向いているのではと思います。

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?