#keccak #hashing #algorithm #hash #data #version #hammer

bin+lib dia-hammer

A program helping with hashing data via Keccak algorithms

15 releases (stable)

2.1.1 Jul 6, 2022
2.1.0 Mar 2, 2021
2.0.1 Jan 16, 2021
1.4.0 Aug 12, 2019
0.4.1 Mar 30, 2019

#2585 in Command line utilities

Custom license and maybe LGPL-3.0-or-later

28KB
545 lines

Dia-Hammer




lib.rs:

Dia-Hammer

Project

Features

  • This program helps hash data from either an input string, stdin, or file(s).
  • Supported algorithms: SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128, SHAKE256.

Building from source or installing via Cargo

This crate is intended to be used as a program. So default features just contain some documentation, constants and no dependencies.

bin feature contains a binary which uses some dependencies.

Building from source:

~> # Clone a specific version via tag name
~> git clone --branch=x.y.z --depth=1 -- https://bitbucket.org/haibison/hammer hammer-x.y.z/
~> cd hammer-x.y.z/
~> cargo build --release --features=bin

Installing via Cargo:

~> cargo install dia-hammer --version=x.y.z --features=bin

Examples

~> # Print help
~> hammer help
...

~> # Hash an input string
~> hammer shake-128 haha
05ea9934234a88a31e67a1638a7936d7 (Shake-128)

~> # Hash multiple input files
~> hammer sha3-224 -- /tmp/*.json
6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7 [SHA3-224] /tmp/haha.json
1931dd1553cf52ee145747ad8c0f34906022eeb788a6aa955bbf3600 [SHA3-224] /tmp/test.json

~> # Hash data fed via stdin
~> cat /tmp/test.json | hammer sha3-256
cd424cbc9ab978b547332e3ee4f2ebfe715e9cd9144a5437982cc6e16327a0eb (SHA3-256)

~> # Hash a string and print the hash as hex-array, which is useful for programmers
~> hammer shake128 namaste --format=hex-array
[0xe3, 0xcd, 0x77, 0x06, 0x27, 0x84, 0x1f, 0x8e, 0xb6, 0x0c, 0xfd, 0x3e, 0xa6, 0x93, 0x17, 0x1e] (Shake-128)

~> # On Unix, hash 64 KiB of data from /dev/urandom
~> hammer sha3-224 --limit=65536 -- /dev/urandom
3779d6c9ce150bd02ebfa7e353c85bc4934c0a16ebf736946143f121 [SHA3-224] /dev/urandom

Dependencies

~105KB