tuweni / org.apache.tuweni.crypto / Hash

Hash

class Hash (source)

Various utilities for providing hashes (digests) of arbitrary data. Requires the BouncyCastleProvider to be loaded and available. See https://www.bouncycastle.org/wiki/display/JA1/Provider+Installation for detail.

Functions

digestUsingAlgorithm

Helper method to generate a digest using the provided algorithm.

static fun digestUsingAlgorithm(input: ByteArray!, alg: String!): ByteArray!
static fun digestUsingAlgorithm(input: Bytes!, alg: String!): Bytes!

keccak256

Digest using keccak-256.

static fun keccak256(input: ByteArray!): ByteArray!
static fun keccak256(input: Bytes!): Bytes32!

keccak512

Digest using keccak-512.

static fun keccak512(input: ByteArray!): ByteArray!
static fun keccak512(input: Bytes!): Bytes!

sha2_256

Digest using SHA2-256.

static fun sha2_256(input: ByteArray!): ByteArray!
static fun sha2_256(input: Bytes!): Bytes32!

sha2_512_256

Digest using SHA2-512/256.

static fun sha2_512_256(input: ByteArray!): ByteArray!

Digest using SHA-512/256.

static fun sha2_512_256(input: Bytes!): Bytes32!

sha3_256

Digest using SHA3-256.

static fun sha3_256(input: ByteArray!): ByteArray!
static fun sha3_256(input: Bytes!): Bytes32!

sha3_512

Digest using SHA3-512.

static fun sha3_512(input: ByteArray!): ByteArray!
static fun sha3_512(input: Bytes!): Bytes!