-
Notifications
You must be signed in to change notification settings - Fork 16
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
Valid fake hashes & additional hash helper utilities #216
Conversation
This reverts commit 04bf0b3.
…me functions for consistency
…hash, in order to generate a determanistic fake hash
@jost-s tagging you to request review since I can't don't have permission to assign you. |
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! Thanks for the complete feature
@jost-s should be all set -- I don't have permission to merge |
Great, and thanks for the changelog! |
* feat: produce valid fake hashes with valid checksum * fix: core of hash is 32 bytes * fix: hash * Revert "fix: hash" This reverts commit 04bf0b3. * fix: hash fn * fix: hash length * feat: add functions to slice hash into prefix, core, and dht location bytes * chore: comment * feat: add functions to generate full hash from core 32 and type, rename functions for consistency * chore: rename test utils to common to make room for tests against utilty functions * chore: remove unused hash types * test: tests that fake hash functions produce valid hashes * build: fix typescript module declaration for @bitgo/blake2b * doc: generate docs * feat: specify a core byte to repeate for all core 32 bytes of a fake hash, in order to generate a determanistic fake hash * test: add tests for hash slice and hash construct utils * chore: capital-case hashTypePrefix dict * chore: spelling * doc: changelog
dhtLocationFrom32
to construct valid dht location bytes from core 32 bytesfakeAgentPubKey
,fakeEntryHash
,fakeActionHash
,fakeDnaHash
to produce valid hashes, and to optionally take a paramcoreByte
which will be repeated for all core 32 bytessliceDhtLocation
,sliceCore32
,sliceHashType
hashFrom32AndType
hashTypePrefix
to store hash type label -> hash type bytes@bitgo/blake2b
Feel free to rename functions as you please.