corda / net.corda.core.crypto / SecureHash

# SecureHash

`sealed class SecureHash : OpaqueBytes`

Container for a cryptographically secure hash value. Provides utilities for generating a cryptographic hash using different algorithms (currently only SHA-256 supported).

### Types

SHA256 | `class SHA256 : SecureHash` SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes)

### Inherited Properties

bytes | `val bytes: ByteArray`
size | `val size: Int`

### Functions

hashConcat | `fun hashConcat(other: SecureHash): SHA256`
prefixChars | `fun prefixChars(prefixLen: Int = 6): String`
toString | `open fun toString(): String`

### Inherited Functions

equals | `open fun equals(other: Any?): Boolean`
hashCode | `open fun hashCode(): Int`
open | `fun open(): ByteArrayInputStream` Returns a ByteArrayInputStream of the bytes

### Companion Object Properties

zeroHash | `val zeroHash: SHA256`

### Companion Object Functions

parse | `fun parse(str: String): SHA256`
randomSHA256 | `fun randomSHA256(): SHA256`
sha256 | `fun sha256(bytes: ByteArray): SHA256` `fun sha256(str: String): SHA256`
sha256Twice | `fun sha256Twice(bytes: ByteArray): SHA256`

### Extension Functions

deserialize | `fun <T : Any> OpaqueBytes.deserialize(kryo: Kryo = threadLocalP2PKryo()): T`
sha256 | `fun OpaqueBytes.sha256(): SHA256`

### Inheritors

SHA256 | `class SHA256 : SecureHash` SHA-256 is part of the SHA-2 hash function family. Generated hash is fixed size, 256-bits (32-bytes)