Skip to content
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

Introduce hex::display for Display’ing binary data in hex #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mina86
Copy link

@mina86 mina86 commented Jul 19, 2023

encode method allocates a new string which is wasteful if all one
wants to do is display the binary data using format! or related macro.

Introduce hex::Display wrapper with hex::display as its constructor
which wraps the binary data in an object that implements Display,
LowerHex, UpperHex and Debug and formats the data as hex. However, as
it uses buffers on stack, it performs no allocations.

encode method allocates a new string which is wasteful if all one
wants to do is display the binary data using format! or related
macro.

Introduce hex::Display wrapper with hex::display as its constructor
which wraps the binary data in an object that implements Display,
LowerHex, UpperHex and Debug and formats the data as hex.  However,
as it uses buffers on stack, it performs no allocations.
@mina86
Copy link
Author

mina86 commented Nov 11, 2023

@KokaKiwi, friendly ping.

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.

None yet

1 participant