-
Notifications
You must be signed in to change notification settings - Fork 81
fix: use correct hex capacity for word and digest hex encoding #1675
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
base: next
Are you sure you want to change the base?
Conversation
|
@igamigo Sorry for delay, reopened PR |
| self.w2, | ||
| self.w3 | ||
| ) | ||
| .unwrap(); |
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.
Please add a safety comment explaining why this is OK to unwrap
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.
Please add a safety comment explaining why this is OK to unwrap
added comments
package-lock.json
Outdated
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.
Why was this committed?
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.
Why was this committed?
It's a good question and I don't know hpw it could appear, i didn't add this manually, but maybe there were issues with my branch
Reopen #1631
Adjust hex encoding buffers to allocate enough capacity for the full 64-character hexadecimal representation of a Word. Previously we used 32/Word::SERIALIZED_SIZE (bytes) as the Vec capacity, which was half of the required number of characters and caused unnecessary reallocations; now both word.rs and digest.rs use Word::SERIALIZED_SIZE * 2 for consistent and efficient hex formatting.