Skip to content
Vali (naser) Rafinia edited this page Mar 27, 2023 · 7 revisions

nHash is a command-line tool for hashing files and strings in Linux. This guide will help you get started with nHash and show you how to use its various features.

Installation

To use nHash, you must first download and install it on your Linux or Windows system. The easiest way to do this is by downloading the latest release from the releases page and extracting the binary to your preferred location.

Basic Usage

Once you have installed nHash, you can start using it to hash files and strings. Here are some basic examples to get you started.

To hash a file, use the nhash hash calc --file command followed by the path to the file. By default, nHash will use the SHA-256 algorithm.

nhash hash calc --file /path/to/file

You can specify a different hashing algorithm using the -t or --type option, followed by the algorithm name.

nhash hash calc --file /path/to/file --type sha1

To hash a string, use the nhash hash calc string command followed by the string you want to hash.

nhash hash calc "hello world"

You can also pipe input into nHash using the standard Linux pipe operator.

echo "hello world" | nhash encode base64

Command Options

nHash provides various options that you can use to customize its behavior. Here are some of the global commonly used options.

  • -o, --output: Writes the output to a file instead of printing it to the console.
  • -h, --help: Displays the help message and exits.

Conclusion

nHash is a powerful tool that provides various hash and text utilities in Linux and Windows. Its easy-to-use command-line interface and support for multiple hashing algorithms, encode methods, powerful password generator, etc make it an essential tool for any developer or system administrator.