Skip to main content
The h (hash) command calculates cryptographic hash values and checksums for files without archiving them.

Syntax

Description

The hash command:
  • Calculates checksums for file verification
  • Supports multiple hash algorithms
  • Can process multiple files and directories
  • Generates hashes without compression
  • Useful for integrity verification
  • Can output in various formats

Supported Hash Algorithms

7-Zip supports several hash functions:

CRC32

32-bit cyclic redundancy check
  • Fast computation
  • Good for error detection
  • 8 character hex output

CRC64

64-bit cyclic redundancy check
  • Better collision resistance than CRC32
  • 16 character hex output

SHA256

256-bit secure hash
  • Cryptographically secure
  • Industry standard
  • 64 character hex output

SHA1

160-bit secure hash (deprecated)
  • Older standard
  • Not recommended for security
  • 40 character hex output
Additional algorithms (version dependent):
  • BLAKE2sp - Fast cryptographic hash
  • XXH64 - Extremely fast non-cryptographic hash

Common Options

string
Files or directories to hash. Supports wildcards.Example: *.txt or documents/
string
Set hash function to use. Options:
  • CRC32 - 32-bit CRC (default)
  • CRC64 - 64-bit CRC
  • SHA256 - SHA-256 hash
  • SHA1 - SHA-1 hash
  • XXH64 - xxHash 64-bit
  • BLAKE2SP - BLAKE2sp hash
  • * - All available methods
Example: -scrcSHA256
flag
Recurse subdirectories.
string
Include files matching pattern.Example: -i!*.txt
string
Exclude files by pattern.Example: -x!*.tmp
flag
Store hard links as links.
flag
Store symbolic links as links.

Examples

Calculate CRC32 for a file

Output:

Calculate SHA256 hash

Output:

Calculate multiple hash types

Output:

Hash all files in directory

Hash with specific algorithm

Hash excluding certain files

Hash and redirect to file

Understanding Hash Output

Data Hash

Hash of file contents only.

Data and Names Hash

Hash of file contents combined with file paths.

Multiple Files

Use Cases

File Integrity Verification

Create checksum file

Verify later

Download Verification

Duplicate Detection

Generate Checksums for Distribution

Advanced Examples

Hash with multiple algorithms

Recursive hash with pattern

Hash and sort by filename

Compare directory trees

Verify archive contents without extraction

Scripting Examples

Create and Verify Checksums

Monitor File Changes

Batch File Verification

Hash Algorithm Comparison

When to Use Each

CRC32/CRC64 - Quick integrity checks, non-security use
SHA256 - File verification, security, distribution
Multiple Hashes - Maximum verification

Performance Tips

  1. CRC is fastest - Use CRC32/CRC64 for speed
  2. SHA256 for security - Use when cryptographic security needed
  3. Batch processing - Hash multiple files in one command
  4. Exclude unnecessary files - Use -x to skip temp files
  5. Pipe for single file - Direct file to stdin for single hash
The “data and names” hash includes file paths in the calculation, making it useful for verifying both content and directory structure.
For ISO verification, use SHA256:
Compare output with published hash from official source.
SHA1 is considered cryptographically broken. Use SHA256 or BLAKE2SP for security-critical applications.

Integration Examples

With MD5SUM format (conversion)

Verify Against Published Hashes