Overview
b2sum generates a unique digital fingerprint, known as a checksum, for a file using the BLAKE2 algorithm. This checksum allows for a quick verification of whether the file's content has been altered. It is particularly useful for verifying the integrity of large files.
Key Features
- High-performance hash calculation using the BLAKE2 algorithm
- Verification of file integrity and detection of data corruption
- Functionality to create checksum files and perform batch verification
- Adjustable digest length
Key Options
The primary options for the b2sum command control the checksum calculation method, output format, and verification behavior.
Basic Operations and Modes
Output and Error Handling
Generated command:
Try combining the commands.
Description:
`b2sum` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Learn how to calculate and verify file checksums through various usage examples of the b2sum command.
Calculate BLAKE2 Checksum for a Single File
b2sum myfile.txt
Calculates and outputs the BLAKE2 checksum for a specified file.
Calculate Checksums for Multiple Files
b2sum file1.txt file2.zip
Calculates and outputs checksums for multiple files at once.
Save Checksums to a File
b2sum important_data.tar.gz > important_data.tar.gz.b2sum
Saves the calculated checksums and filenames to a separate file. This file can be used later for integrity verification.
Verify Integrity Using a Checksum File
b2sum -c important_data.tar.gz.b2sum
Verifies the integrity of the original files using a previously saved checksum file. If all files match, an 'OK' message will be displayed.
Calculate Checksum from Standard Input
echo "Hello BLAKE2" | b2sum
Calculates the checksum for data piped from standard input.
Calculate Checksum with a Specific Length (256 bits)
b2sum -l 256 large_file.iso
Calculates the BLAKE2 digest with a specified length of 256 bits.
Tips & Notes
Tips and points to consider for effective use of b2sum.
Performance and Security
- BLAKE2 offers stronger security than MD5 or SHA-1, with security comparable to SHA-256, while providing faster hash calculation speeds.
- It is particularly useful for verifying the integrity of large files after download, allowing for quick detection of file corruption.
Checksum File Management
- It is recommended to store checksum files (e.g., with a `.b2sum` extension) alongside the original files for easy verification later.
- The content of the checksum file must match the format generated by the `b2sum` command for the `-c` option to work correctly.