chore: add hash and encoding test vectors - #102
Merged
anurag629 merged 1 commit intoOct 1, 2026
Merged
Conversation
anurag629
approved these changes
Oct 1, 2026
Member
There was a problem hiding this comment.
Hey @kudala-bharani, really nice work! I checked the MD5 padding values with Node's crypto and the Ascii85 ones with Python, all of them match. This covers everything in #98.
Small thing for next time, drop a comment on the issue first so I can assign it to you. Saves two people from doing the same work.
If you want to pick up another one, just comment on any open hacktoberfest issue and I'll assign it to you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Closes #98.
Adds the requested reference vectors for MD5 and the encoding helpers. This covers empty input, the 55/56/64-byte MD5 padding boundaries, all five hash keys and digests, partial Ascii85 groups, zero-byte abbreviation, hex formatting, line wrapping, byte sizes, and shell/SQL quoting.
The MD5 boundary values were generated once with Node's
crypto.createHashand stored as constants. Ascii85 vectors were also checked against Python's standard-library encoder. No production code changes were needed.Type of change
Checklist
npm run lint && npm run test && npm run buildpasses locallylib/__tests__/; no production logic changesNotes for reviewers
One test file changed, with 29 new test cases. On Node 22.23.3, all 56 tests pass and the production build succeeds. Lint exits successfully with 13 existing warnings in unchanged files; the modified test file has no warnings.