Skip to content

variable hash functions testing#161

Merged
Jorropo merged 3 commits intomultiformats:masterfrom
Jorropo:feat/variable-hash-functions-testing
Aug 12, 2022
Merged

variable hash functions testing#161
Jorropo merged 3 commits intomultiformats:masterfrom
Jorropo:feat/variable-hash-functions-testing

Conversation

@Jorropo
Copy link
Contributor

@Jorropo Jorropo commented Aug 12, 2022

squashed version of #160

Stebalien and others added 3 commits July 28, 2022 15:43
This makes it possible to register hasher factories that take a size
hint. Such hashers should produce at least the requested number of
bytes, but may:

1. Produce fewer bytes in some cases (e.g., not enough input is available).
2. May produce more bytes (the usual case).

The caller should check the size of the produced digest to determine if
it's sufficient for the caller's use-case (likely truncating it if it's
too large).

NOTE: the convenience `Sum` function will handle size verification and
truncation internally.
@Jorropo Jorropo merged commit 16974ad into multiformats:master Aug 12, 2022
@Jorropo Jorropo deleted the feat/variable-hash-functions-testing branch August 12, 2022 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants