arrow-refined-types / arrow.refinement.digests / SHA224

SHA224

class SHA224

SHA224 constrains String to be a valid hexadecimal String of length 56

Safe nullable construction

import arrow.refinement.digests.SHA224

SHA224.orNull("90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809")
SHA224.orNull("not-sha224")

Resolved constraints

SHA224.constraints("90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809")
SHA224.constraints("not-sha224")
SHA224.isValid("90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809")
SHA224.isValid("not-sha224")

Folding validation

SHA224.fold("90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809", { "failed: $it" }, { "success: $it" })
SHA224.fold("not-sha224", { "failed: $it" }, { "success: $it" })

Unsafe require

SHA224.require("90a3ed9e32b2aaf4c61c410eb925426119e1a9dc53d4286ade99a809")
try { SHA224.require("not-sha224") } catch (e: IllegalArgumentException) { e.message }

Types

Companion companion object Companion : Refined<String, SHA224>

Properties

value val value: String

Do you like Arrow?

Arrow Org
<