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

MD5

class MD5

MD5 constrains String to be a valid hexadecimal String of length 32

Safe nullable construction

import arrow.refinement.digests.MD5

MD5.orNull("098f6bcd4621d373cade4e832627b4f6")
MD5.orNull("not-md5")

Resolved constraints

MD5.constraints("098f6bcd4621d373cade4e832627b4f6")
MD5.constraints("not-md5")
MD5.isValid("098f6bcd4621d373cade4e832627b4f6")
MD5.isValid("not-md5")

Folding validation

MD5.fold("098f6bcd4621d373cade4e832627b4f6", { "failed: $it" }, { "success: $it" })
MD5.fold("not-md5", { "failed: $it" }, { "success: $it" })

Unsafe require

MD5.require("098f6bcd4621d373cade4e832627b4f6")
try { MD5.require("not-md5") } catch (e: IllegalArgumentException) { e.message }

Types

Companion companion object Companion : Refined<String, MD5>

Properties

value val value: String

Do you like Arrow?

Arrow Org
<