hash

hash calculates file or text digests, selects algorithms, produces HMAC with a hidden key or key file, verifies an expected digest and supports hexadecimal or Base64 output.

SecurityVersion 1.1.4Stable
lil-terminal

Overview

Use a digest to identify or compare data and HMAC when verification must also depend on a secret. The normal output contains only the digest, so it can be copied or redirected without removing labels.

A digest and an HMAC answer different questions

A plain hash detects whether data changed, but anyone who has the data can calculate the same value. HMAC adds a secret key to the check. Neither operation encrypts the input or makes its contents recoverable from the digest.

Syntax

lil-terminal
hash [<file>|-s "<text>"] [-a <algo>] [-h|-K <file>] [-b] · hash -c <digest> <file> [-b]

Reference

hash

list available hashing algorithms

hash <file>

calculate a SHA-256 file hash

hash -s "<text>"

calculate a string hash; quote text that contains spaces

hash <file> -a sha512

select another algorithm

hash <file> -h

calculate HMAC with a hidden key prompt

hash <file> -K <keyfile>

calculate HMAC with a key file

hash -c <digest> <file>

verify a hexadecimal digest

hash -c <digest> <file> -b

verify or print Base64 instead of hexadecimal

Interactive sandbox preview

Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.

Compare SHA-256 and SHA-512

Install and manage

Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.

Base and Minimum are two packages of the same current module release, not separate command versions.

Base package

Install the complete package with local command reference and every published mode.

install hash
Minimum package

Install the reduced package. Local reference is omitted; help <cmd> -i opens the current server reference.

install hash -m
Exact public version

Install exactly this published version.

install hash -v 1.1.4
Check or update

Ask upgrade to check compatibility and replace the installed block only when needed.

upgrade hash
Remove module

Remove the extension block while leaving the core and unrelated modules intact.

install hash -u

Examples

Examples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.

Compare SHA-256 and SHA-512
cd \sandbox | hash feed.xml | hash feed.xml -a sha512
188ee21132d020e7fe625c0f38176f34bdc7767f6c1ac02fc7bc1931f272683c

5f1f6f5df6f4d3e55fb2c8c29aa1f3f89b3e49d6f1c4f7719ce349567de5a038…
Calculate a string hash; quote text that contains spaces
hash -s "HELLO WORLD!"
8c1cf4584c78d2172ad61a3fca18f1bb4c18d2d01c9b75a5d3f02b6759b74129
Select another algorithm
hash \sandbox\feed.xml -a sha512
5f1f6f5df6f4d3e55fb2c8c29aa1f3f89b3e49d6f1c4f7719ce349567de5a038…
Calculate HMAC with a hidden key prompt
hash \sandbox\feed.xml -h
key  ••••••••
4ca35029d82f0f98bb6c6d4f39ed0ad7e1ad7368b0fe0f2f5dc18e4b716f65cb
Calculate HMAC with a key file
hash \sandbox\feed.xml -K \sandbox\keys\hash.key
68d91f0e19b5584d4af4b2e32684333c202bc805572e8a9b8f4e7be2e9aebc37
List available hashing algorithms
hash
adler32       crc32         fnv132        gost          haval128,3
crc32b        crc32c        fnv1a32       gost-crypto   haval128,4
fnv164        fnv1a64       joaat         md2           md4
md5           murmur3a      murmur3c      ripemd128     ripemd160
sha1          sha224        sha256        sha384        sha512
Verify a hexadecimal digest
hash -c <digest> \sandbox\feed.xml
Status     Verified
Algorithm  sha256
Verify or print Base64 instead of hexadecimal
hash -c <base64> \sandbox\feed.xml -b
Status     Verified
Algorithm  sha256
Reject a missing file
hash \sandbox\missing.txt
Path not found

File used in this example: sandbox/data/sample.txt

The example uses a file or directory from the protected /sandbox/ documentation workspace.

lil-terminal sandbox text file

This file is safe to read, copy, rename, replace, hash and archive.

Related documentation

Current public release

v1.1.42026-08-12

Bare hash inventory

Typing hash alone now lists available algorithms; the redundant -l flag is removed.