h (Hash) command

7-Zip 18

h (Hash) command

Calculate hash values for files.

Syntax

h [-scrc{Method}] [files]

Supported methods: CRC32, CRC64, SHA1, SHA256, BLAKE2sp. Default method is CRC32.

Examples

7z h a.txt

calculates CRC32 for a.txt.

7z h -scrcsha256 a.iso

calculates SHA256 for a.iso.

7z h *

calculates CRC32 for all files in current folder and all subfolders.

Notes

7-Zip shows hash values for each file, the sum of hash values and the sum that includes all hash values of data and all hash values for filenames.

7-Zip represents hash values for CRC32 and CRC64 as integer numbers in hex.

7-Zip represents hash values For SHA1, SHA256 and BLAKE2sp as sequence of bytes in hex.

Switches that can be used with this command

-i (Include) -m (Method)
-r (Recurse)
-scrc (Set hash method)
-si (use StdIn)
-sns (Store NTFS alternate Streams)
-ssw (Compress shared files)
-x (Exclude)