-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: implement hashInto() api for as-sha256 #382
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a section to the PR description labeled BREAKING CHANGE that describes what has broken?
I just added it 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm post merge review
Motivation
The hashInto() api of hashtree is very efficient in terms of memory allocation for the consumer because they can preallocate output and reuse over multiple hashes, they can also hash into the same input Uint8Array
Description
digest64HashObjectsInto()
which is similar todigest64HashObjects()
but this does not allocate new HashObjectbyteArrayIntoHashObject()
which is similar tobyteArrayToHashObject()
, but this does not allocate new HashObjectall of these functions are used by
persistent-merkle-tree
andssz
in upcoming PRsBREAKING CHANGE
offset
param tobyteArrayToHashObject()
so that consumer can use the same big Uint8Array to extract HashObject from a subsection of it without usingsubarray()
part of #378