[][src]Crate dia_hammer

Dia-Hammer

Project

Features

  • This program helps hash data from either an input string, stdin, or file(s).
  • Supported algorithms: keccak-224, keccak-256, keccak-384, keccak-512, sha3-224, sha3-256, sha3-384, sha3-512, shake-128, shake-256.

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:

$ cargo build --release --features=bin

Installing via Cargo:

$ cargo install dia-hammer --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)

References

Modules

version_info

0.2.0 (March 26th, 2019)

Constants

CODE_NAME

Crate code name

NAME

Crate name

RELEASE_DATE

Crate release date (year/month/day)

TAG

Tag, which can be used for logging...

UUID

Unique universally identifier of this crate

VERSION

Crate version