-
Notifications
You must be signed in to change notification settings - Fork 1
Hash Calc
Vali (naser) Rafinia edited this page Mar 27, 2023
·
2 revisions
The nhash hash calc
command is used to calculate hash fingerprints of a given text or file. This command supports a variety of hash algorithms, including MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA-3, Blake2b, and Blake2s.
nhash hash calc [<text>] [options]
The text
argument is optional, and the user can provide a filename instead with the --file
option. The hash algorithm can be specified with the --type
option, which defaults to All to calculate all available hash types. The generated hash can be converted to lowercase using the --lower
option.
The output can be written to a file using the --output
option. If this option is not provided, the output will be printed to the console.
-
-f, --file
: Filename to calculate hash. -
--lower
: Generate hash in lowercase. -
-t, --type
: Hash algorithm to use (MD5, SHA-1, SHA-256,...). The default value isAll
. -
-o, --output
: Filename to write the output to.
- Calculate MD5 hash of a string:
nhash hash calc "Hello World" -t md5
- Calculate SHA-256 hash of a file:
nhash hash calc -f /path/to/file -t sha256
- Calculate all available hash types of a file and write the output to a file:
nhash hash calc -f /path/to/file --output /path/to/output/file