sha256のチェックサムを表示する方法

Twitter ツイート Hatena Bookmark ブックマーク

chefを使っているとchecksumのトラブルでインストールできないこと多いですよね。
特にバージョンを変えてインストールしたい場合とか、そんな時につらいことありますよね。

で、結局自分で調べなければいけないなんてことなるわけです。

そんな時につかうchecksum

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$ shasum -h
Usage: shasum [OPTION]... [FILE]...
Print or check SHA checksums.
With no FILE, or when FILE is -, read standard input.

  -a, --algorithm   1 (default), 224, 256, 384, 512, 512224, 512256
  -b, --binary      read in binary mode
  -c, --check       read SHA sums from the FILEs and check them
  -t, --text        read in text mode (default)
  -p, --portable    read in portable mode
                        produces same digest on Windows/Unix/Mac
  -0, --01          read in BITS mode
                        ASCII '0' interpreted as 0-bit,
                        ASCII '1' interpreted as 1-bit,
                        all other characters ignored

The following two options are useful only when verifying checksums:
  -s, --status      don't output anything, status code shows success
  -w, --warn        warn about improperly formatted checksum lines

  -h, --help        display this help and exit
  -v, --version     output version information and exit

When verifying SHA-512/224 or SHA-512/256 checksums, indicate the
algorithm explicitly using the -a option, e.g.

  shasum -a 512224 -c checksumfile

The sums are computed as described in FIPS-180-4.  When checking, the
input should be a former output of this program.  The default mode is to
print a line with checksum, a character indicating type (`*' for binary,
` ' for text, `?' for portable, `^' for BITS), and name for each FILE.

Report shasum bugs to [email protected]

chef使ってるとsha256のハッシュ値が求められるので、以下のようにコマンドを実行します。

1
2
$ shasum -a 256 kibana-3.1.2.tar.gz
480562733c2c941525bfa26326b6fae5faf83109b452a6c4e283a5c37e3086ee  kibana-3.1.2.tar.gz
comments powered by Disqus
Built with Hugo
テーマ StackJimmy によって設計されています。