baml.crypto.Hasher

A stateful hasher that can be used to compute a digest of data.

Reference version

Signature

interface baml.crypto.Hasher

A stateful hasher that can be used to compute a digest of data.

Source:<builtin>/baml/ns_crypto/interfaces.bamlbytes 68–710

Required instance methods

function

update

(self, data: uint8array) -> null throws never

Feeds data into the hasher's internal state.

function

finish

(self) -> uint8array throws never

Returns the digest of the hasher's internal state.

Hasher state may either reset after this call or remain unchanged. Implementations should specify which behavior should be expected. As a result, opaque callers should not rely on the hasher state after this call.

Provides no contract about the size or format of the digest, each implementation should document its own digest format.