sha3

command
v0.0.0-...-0b9d80d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2016 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Command sha3 prints the binary SHA-3 digest of its input. It computes the fixed-output-length hash functions defined by FIPS-202, and produces exactly length/8 bytes of output.

Usage:

sha3 [-n length]

Flag -n specifies which size output to compute. Length can be 224, 256, 384, or 512. The default is 256. Note that the shorter lengths are not just a truncated form of the longer ones. FIPS 202 specifies different construction parameters for each output size, so they compute different hash functions.

Examples

Show the hex-encoded SHA3-256 digest of the string "hello":

printf hello | sha3 | hex

Obtain the 64-byte SHA3-512 digest of the string "hello" in Go:

cmd := exec.Command("sha3", "-n", "512")
cmd.Stdin = strings.NewReader("hello")
hash, err := cmd.Output()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL