-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
coalesce (bytes2hex, num2hex, hex) and (bin, bits, etc.) #14418
Comments
cc: @mason-bially, @nalimilan, @tkelman |
I'd like to reiterate that it would be amazing if there was a way to stick this functionality into the Additionally all of the existing With all of that said, it seems we have:
Already. All of these methods provide padding.
I think we could provide better standard behavior by having a way to set the padding to "max width of type". Maybe by setting padding to zero, or passing a type to dispatch off of like
While we're on the topic, it would be nice if bytestring, or something, took an
Now the last major hurdle in my opinion is useful printing of a large dump of hex, basically hexdump in a function. Aiming for something like (from wikipedia):
or
But I'm not sure how to encapsulate that in a function yet. Maybe have a DumpFormatter type which would describe spacing, starting location of the addresses, whether to include the ASCII view on the left, etc. So maybe:
Where DumpFormat can be constructed with various different keywords to enable different behavior. But that's my wishlist. I'd be happy if we happen to prune all the methods we currently have down to 5. |
I did a search. This is the only file on GitHub that uses hex2num(bytes2hex(bytes[1:8])), 8 to parse(Float64, hex(bytes[1:8]), 16, binary=true), 8 There is probably a faster way to pull a float out of memory and into Julia anyway... |
Yes, I suspect that |
We appear to have deleted most of these by now. |
It was noted in the conversation on #14341 that
bytes2hex
is very similar in functionality tohex
andnum2hex
. There's also overlap betweenbin
andbits
. Of coursehex2bytes
is also a form of number parsing. This is a design issue to discuss how to reduce and systematize the number of functions for printing and parsing numbers in different bases.The text was updated successfully, but these errors were encountered: