HashFunction

interface HashFunction

A cryptographic hash function (algorithm)

Properties

Link copied to clipboard
abstract val blockSizeBytes: Int

The size of the hashing block in bytes.

Link copied to clipboard
abstract val digestSizeBytes: Int

The size of the digest output in bytes.

Functions

Link copied to clipboard
abstract fun digest(): ByteArray

Finalize the hash computation and return the digest bytes. The hash function will be reset after the call is made.

Link copied to clipboard
abstract fun reset()

Resets the digest to its initial state discarding any accumulated digest state.

Link copied to clipboard
abstract fun update(input: ByteArray, offset: Int = 0, length: Int = input.size - offset)

Update the running hash with input bytes. This can be called multiple times.