Skip to content

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.

Usage

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.

Options

  • -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 is All.
  • -o, --output: Filename to write the output to.

Examples

  1. Calculate MD5 hash of a string:
nhash hash calc "Hello World" -t md5
  1. Calculate SHA-256 hash of a file:
nhash hash calc -f /path/to/file -t sha256
  1. 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
Clone this wiki locally