Module

pooka/hash

src/pooka/hash.pooka

Give a byte parcel a short, reproducible fingerprint.

Expose SHA-256 through Erlang crypto. The digest is a bit array of thirty-two bytes, not a hexadecimal string and not a password-storage scheme.

Pooka
import pooka/bit_array
import pooka/hash

assert bit_array.byte_size(hash.sha256(bit_array.from_string("hello"))) == 32

API reference

function

sha256

src/pooka/hash.pooka:29
sha256(data: BitArray) -> BitArray
INFERREDfn(BitArray) -> BitArray

Compute a 256-bit SHA-256 digest. The result contains raw digest bytes.

Pooka
import pooka/bit_array
import pooka/hash

assert bit_array.byte_size(hash.sha256(bit_array.from_string("hello"))) == 32