hash

abstract suspend fun hash(data: ByteArray): ByteArray

Computes the SHA-256 hash of the input data.

On JavaScript platforms, this function is suspend to allow proper libsodium initialization. On JVM and Native platforms, the suspend keyword has zero overhead.

Return

The 32-byte SHA-256 hash

Parameters

data

The data to hash