Skip to content

Hash Checksum

Naser edited this page Mar 27, 2023 · 5 revisions

The checksum sub-command of nhash can be used to calculate the checksum fingerprint of a given text or file. This sub-command supports various checksum algorithms such as MD5, SHA-1, CRC32, CRC8, Adler-32, etc.

Usage

nhash hash checksum [<text>] [options]

Options

The checksum sub-command supports the following options:

  • -f, --file <file>: Use the specified file to calculate the checksum.
  • --lower: Generate the checksum in lowercase.
  • -t, --type <type>: Use the specified checksum algorithm. Supported values are: Adler32, All, CRC32, CRC8, Fletcher16, Fletcher32, MD5, and SHA1. The default value is All.
  • -v, --verify <verify>: Use the checksum type provided to verify your checksum.
  • -o, --output <output>: Write the checksum output to the specified file.

Examples

  1. Calculate the MD5 checksum of a given text:
nhash hash checksum "Hello, World" -t md5

Output:

82BB413746AEE42F89DEA2B59614F9EF
  1. Calculate the SHA-1 checksum of a file:
nhash hash checksum -f /path/to/file.txt -t sha1

Output:

4c174d42b3c8c83dbd5c670b4f9ee9f11e83187a
  1. Verify a checksum:
nhash h ch "Hello, World" -t md5 -v 82BB413746AEE42F89DEA2B59614F9EF
  1. Calculate multiple checksums at once:
nhash hash checksum -f /path/to/file.txt -t all

Output:

MD5:
82BB413746AEE42F89DEA2B59614F9EF

SHA-1:
907D14FB3AF2B0D4F18C2D46ABE8AEDCE17367BD

SHA-256:
03675AC53FF9CD1535CCC7DFCDFA2C458C5218371F418DC136F2D19AC1FBE8A5

SHA-384:
C7B9B2DBBDD22B8A3A4AD011E326D536F603A404E55AF47196A24DB6513D877706D122B35D5B45DAEB6674F9527E9659

SHA-512:
45546D4D71407E82ECDA31EBA5BF74B65BC092B0436A2409A6B615C1F78FDB2D3DA371758F07A65B5D2B3EE8FA9EA0C772DD1EFF884C4C77D4290177B002CCDC

SHA-3 (224):
1CDB48E04A67B9F279A73FDA2EE54F8A1B7D44544BCFC880F2A426B3

SHA-3 (256):
844AF7BF6A5D414359DCD8845CB52D515397410E1668E00C8469EA8728C4FFE8

SHA-3 (384):
43E6795EC409E73C214049E15E70BC496AE835024AEB8551E82A5F76AC62F48AA2E36E49E1C1A214009C46E66C9D93E9

SHA-3 (512):
9C3A3FA0B427F9C4CCFCE4E5B33041F7A5F3DE1DBBA1B3D6CF818DE4DF58BCB54665D079781939CAA9B56E9F16C4B94AEEA9EC13B5072CBDF6BF0AAD2E77FEF2

Blake2b :
E4124F7A9E4E72436480014B0B2144E7193B3C3AD15877DB9124AE313D4349083C6642D1F8E8BC349255AA466D8D9B6EBDE8B8C2545514EEBA46A32F37457095

Blake2s :
A0D51493AE3FB2DFC3D3B2701877675590B0A769EA01826876CB294CD5880B5A

Clone this wiki locally