Skip to content

refactor(Hash): store raw digest bytes in arrays#15

Open
selfisekai wants to merge 6 commits intozkat:latestfrom
selfisekai:raw-digest-hash
Open

refactor(Hash): store raw digest bytes in arrays#15
selfisekai wants to merge 6 commits intozkat:latestfrom
selfisekai:raw-digest-hash

Conversation

@selfisekai
Copy link
Copy Markdown

BREAKING CHANGE: new type signature of Hash, digest lengths are now validated

Fixes: #5

BREAKING CHANGE: new type signature of Hash, digest lengths are now validated

Fixes: zkat#5
@selfisekai selfisekai marked this pull request as ready for review December 5, 2024 17:28
Comment thread src/hash.rs Outdated
@zkat
Copy link
Copy Markdown
Owner

zkat commented Dec 5, 2024

This is a pretty big, API-visible breaking change. While the refactor does seem nicer, do you have benchmark numbers on what difference they might make? The difference would need to be noticeable in order to justify this, imo.

@selfisekai
Copy link
Copy Markdown
Author

No, my focus was on correctness. Seems to be less than statistical error on a quick check.

Added new APIs for convenience. I think all API breakages have an easy migration path now:

  • Hash { algorithm, digest } -> Hash::from_algorithm_digest_str(algorithm, digest)
  • hash.algorithm -> hash.algorithm()
  • hash.digest -> hash.digest_base64()

@zkat
Copy link
Copy Markdown
Owner

zkat commented Dec 19, 2024

I'm gonna sit on this for a bit. ssri has been fairly stable for a while and if I'm gonna put out a breaking change, I'd like to have more substantial stuff bundled with it.

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.

validate digest lengths

2 participants