Class: Sha3

Sha3

SHA-3 (FIPS 202) ‘Keccak’ hash functions. This is an annotated reference implementation intended to aid understanding of the algorithm. While it is fully tested, it is not at all optimised and is not recommended for production use. See keccak.noekeon.org/Keccak-reference-3.0.pdf nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf

Constructor

new Sha3()

Source:

Classes

Long

Methods

(static) hash224(message, options) → {string}

Generates 224-bit SHA-3 / Keccak hash of message.
Parameters:
Name Type Description
message string String to be hashed (Unicode-safe).
options Object padding: sha-3 / keccak; msgFormat: string / hex; outFormat: hex / hex-b / hex-w.
Source:
Returns:
Hash as hex-encoded string.
Type
string

(static) hash256(message, options) → {string}

Generates 256-bit SHA-3 / Keccak hash of message.
Parameters:
Name Type Description
message string String to be hashed (Unicode-safe).
options Object padding: sha-3 / keccak; msgFormat: string / hex; outFormat: hex / hex-b / hex-w.
Source:
Returns:
Hash as hex-encoded string.
Type
string

(static) hash384(message, options) → {string}

Generates 384-bit SHA-3 / Keccak hash of message.
Parameters:
Name Type Description
message string String to be hashed (Unicode-safe).
options Object padding: sha-3 / keccak; msgFormat: string / hex; outFormat: hex / hex-b / hex-w.
Source:
Returns:
Hash as hex-encoded string.
Type
string

(static) hash512(message, options) → {string}

Generates 512-bit SHA-3 / Keccak hash of message.
Parameters:
Name Type Description
message string String to be hashed (Unicode-safe).
options Object padding: sha-3 / keccak; msgFormat: string / hex; outFormat: hex / hex-b / hex-w.
Source:
Returns:
Hash as hex-encoded string.
Type
string

(private, static) keccak1600(r, c, M, options) → {string}

Generates SHA-3 / Keccak hash of message M.
Parameters:
Name Type Description
r number Bitrate 'r' (b−c)
c number Capacity 'c' (b−r), md length × 2
M string Message
options Object padding: sha-3 / keccak; msgFormat: string / hex; outFormat: hex / hex-b / hex-w.
Source:
Returns:
Hash as hex-encoded string.
Type
string

(private, static) keccak_f_1600(a)

Applies permutation Keccak-f[1600] to state a.
Parameters:
Name Type Description
a Array.<Array.<Long>> State to be permuted (5 × 5 array of Long).
Source: