DigestService

@DoNotImplement
interface DigestService

Provides hashing capabilities to be used in all sandbox types.

Functions

Link copied to clipboard
@NotNull
abstract fun defaultDigestAlgorithm(): DigestAlgorithmName
Returns the defaulted digest algorithm.
Link copied to clipboard
@Suspendable
abstract fun digestLength(@NotNull digestName: DigestAlgorithmName): Int
Returns the DigestAlgorithmName digest length in bytes.
Link copied to clipboard
@Suspendable
@NotNull
abstract fun hash(@NotNull bytes: Array<Byte>, @NotNull digestName: DigestAlgorithmName): SecureHash
Computes the digest of the byte[].
@Suspendable
@NotNull
abstract fun hash(@NotNull inputStream: InputStream, @NotNull digestName: DigestAlgorithmName): SecureHash
Computes the digest of the InputStream.
Link copied to clipboard
@NotNull
abstract fun parseSecureHash(@NotNull algoNameAndHexString: String): SecureHash
Parses a secure hash in string form into a SecureHash.
Link copied to clipboard
@NotNull
abstract fun supportedDigestAlgorithms(): Set<DigestAlgorithmName>
Returns the supported digest algorithms.