-
-
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
rewrite bytes2hex to be more efficient #14341
Comments
Would this be better as a method of |
Perhaps, but there's a nice symmetry between |
While whoever does this is at it, adding tests for |
Come to think of it, |
Sort of ties into #14340 doesn't it? About creating a well factored set of names. |
function names with |
I agree about |
|
Ok, fine, but what does |
One possibility is to say that |
I can't really say what definition makes the most sense, I don't see what are the uses of this function. |
Add hex(x::Vector{UInt8}) & hex(x::ByteString)
It is a common thing to want to hex encode data that have control characters etc., or to encode it for display or debugging. |
Saying "I think this method of this function should do this because I find that specific behavior useful" is not sufficient. We need a definition of what |
I think it's pretty clear
In a multiple dispatch language most of these names are superfluous, like @tkelman seemed to be saying. I can't conceive of another use for Unless you are saying we should pack that functionality up into a narrower protocol (say, get rid of What I find funny is |
Do we have analogous methods for |
Note: no names were changed in my PR, nor any deprecated, although I do think that some deprecations of some x2y named functions would be good in another PR in the future. |
I was being really lazy when I wrote this one-liner:
It's a good intro issue to rewrite this to pre-allocate a byte buffer, go through and fill it with hex characters appropriately and then return that buffer wrapped in a string object.
The text was updated successfully, but these errors were encountered: