Digest

class Digest(@NotNull val digestMode: DigestModes) : KipherProvider

Data authenticity and integrity checks using Cryptographic hash functions (Message Digests).

Constructors

Link copied to clipboard
constructor(@NotNull digestMode: DigestModes)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

DigestModes to be used for MD operations.

Functions

Link copied to clipboard
fun generateHash(@NotNull data: ByteArray): ByteArray

Generate hash from data.

fun generateHash(@NotNull data: Iterable<ByteArray>): ByteArray

Generate hash from multiple data.

Link copied to clipboard
fun generateHashString(@NotNull data: ByteArray): String

Generate hash from data.

Generate hash from multiple data.

Link copied to clipboard
fun verifyHash(@NotNull data: ByteArray, @NotNull expected: ByteArray): Boolean
fun verifyHash(@NotNull data: ByteArray, @NotNull expected: String): Boolean

Verify if data matches the expected hash.

fun verifyHash(@NotNull data: Iterable<ByteArray>, @NotNull expected: ByteArray): Boolean
fun verifyHash(@NotNull data: Iterable<ByteArray>, @NotNull expected: String): Boolean

Verify if multiple data matches the expected hash.