Skip to content

Conversation

@radik878
Copy link

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.

@radik878
Copy link
Author

@igamigo Sorry for delay, reopened PR

self.w2,
self.w3
)
.unwrap();
Copy link
Collaborator

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

Copy link
Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this committed?

Copy link
Author

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

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.

2 participants