elm-cardano/blake2b/2.0.0

Blake2b224

BLAKE2b-224 is a cryptographic hash function (RFC 7693) that gives 112 bits of security with a 28-byte digest.

type Digest

An abstract BLAKE2b-224 digest (28 bytes).

Creating digests

fromString : String -> Digest

Create a digest from a String.

import Blake2b224


Blake2b224.fromString "abc"
    |> Blake2b224.toHex
--> "9bd237b02a29e43bdd6738afa5b53ff0eee178d6210b618e4511aec8"
fromBytes : Bytes -> Digest

Create a digest from Bytes.

fromByteValues : List Int -> Digest

Create a digest from a list of byte values (0-255).

Formatting digests

toHex : Digest -> String

Turn a digest into a hex string.

toBase64 : Digest -> String

Turn a digest into a base64 encoded string.

To binary data

toBytes : Digest -> Bytes

Turn a digest into Bytes. The width is 28 bytes (224 bits).

toByteValues : Digest -> List Int

Turn a digest into a list of byte values (0-255).