はじめに

この資料は Rust 製のコマンドラインツール filehasher について紹介するものです。

Rustの環境構築やツールのインストール方法については以下を参照してください

Rust開発環境を整える

filehasher について

filehasher は、指定したファイルのハッシュダイジェストを取得するCLIツールです。サポートしているハッシュアルゴリズムは md5 , SHA128 , SHA224 , SHA256 , SHA384 , SHA512 です。

GitHub - n1clud3/filehasher: Get hash from a file

デモ

https://github.com/n1clud3/filehasher/raw/master/filehasher_demo.gif

使用方法

filehasher [OPTIONS] <PATH>

オプション

引数

使用例

% filehasher people.json
The MD5 hash of "people.json" is 0ff8f7bbc861a4d976870a0705e0da0a

% filehasher -a md5  people.json
The MD5 hash of "people.json" is 0ff8f7bbc861a4d976870a0705e0da0a

% filehasher -a sha256  people.json
The SHA256 hash of "people.json" is 1b1e61df700028f84bbb871b0c970b7a6204c88d72d92e5e59e058af559e397d

% filehasher -u  -a md5  people.json
0ff8f7bbc861a4d976870a0705e0da0a

% md5sum people.json
0ff8f7bbc861a4d976870a0705e0da0a  people.json