Sha256Crypto

interface Sha256Crypto

Platform-specific SHA-256 cryptographic hash function.

Production-Ready Implementations

All implementations use audited, battle-tested cryptographic libraries:

JVM

  • Library: Java Security API (java.security.MessageDigest)

  • Algorithm: SHA-256

  • Security: FIPS 140-2 compliant, industry standard

iOS/macOS (Native)

  • Library: libsodium (via C interop)

  • Algorithm: SHA-256 via crypto_hash_sha256

  • Security: Audited, constant-time operations

JavaScript (Browser & Node.js)

  • Primary: Web Crypto API (SubtleCrypto.digest)

  • Fallback: libsodium-wrappers (WebAssembly)

  • Security: Hardware-accelerated where available

See also

Properties

Link copied to clipboard
abstract val libraryName: String

Returns the name of the cryptographic library being used.

Functions

Link copied to clipboard
abstract suspend fun hash(data: ByteArray): ByteArray

Computes the SHA-256 hash of the input data.