Calculate hash values for files.
h [-scrc{Method}] [-slf[h][s][n]]
Supported methods: CRC32, CRC64, MD5, SHA1, SHA256, SHA384, SHA512, SHA3-256, XXH64, BLAKE2sp. Default method is CRC32.
Optional -slf[h][s][n] switch determines which fields should be displayed: h: hash, s: size, n: file name. By default (without -slf switch) all these fields will be displayed.
7z h a.txt
calculates CRC32 for a.txt.
7z h -scrcsha256 a.iso
calculates SHA256 for a.iso.
7z h -scrcsha256 -slfh -ba a.iso
calculates SHA256 for a.iso and shows only hash value. It doesn't show additional information about 7-zip program and about file size and file name.
7z h *
calculates CRC32 for all files in current folder and all subfolders.
7-Zip shows the hash value for each file. It also shows the sum of the hash values and a sum that includes all hash values of data and all hash values for filenames.
7-Zip represents the hash value in one of two ways:
These two methods of presentation may look similar, but there is actually a difference between them, as there is a difference between big-endian and little-endian encodings. The difference is in the order of the hexadecimal digits in the value shown.
If more than one file is processed, 7-Zip also calculates the arithmetic sum of the calculated hash values. This arithmetic sum does not depend on the order of the files. So you can compare these arithmetic sum values calculated in different folders on different file systems.
The arithmetic sum value is longer than a single hash value. Therefore, the additional hexadecimal digits of the sum value are displayed after the minus sign: example for CRC32: "F461DFE5-0000001D".
-i (Include)
-m (Method)
-r (Recurse)
-scrc (Set hash method)
-si (use StdIn)
-sns (Store NTFS alternate Streams)
-ssw (Compress shared files)
-x (Exclude)