Well, in my case I don't want to convert the []byte to hexadecimal string, 
because it uses 2x more memory.
The code contains a huge map where the key is an MD5 hash.

Please note that I'm not personally working on this.
I was reviewing the code written by a coworker, and I noticed that there 
was a string variable containing "invalid UTF-8 bytes".
It felt very strange to have a string containing invalid text.

So I have another question: since md5.Sum() is returning a [16]byte, is it 
better to use [16]byte as a map key ?
Or should I use a string containing invalid text as a map key ?

Le mardi 20 août 2019 14:01:38 UTC+2, Sam Whited a écrit :
>
>
>
> On August 20, 2019 11:50:54 AM UTC, Rob Pike <r...@golang.org 
> <javascript:>> wrote: 
> >Printf can print hexadecimal just fine. Never understood the point of 
> >encoding/hex. 
>
> I always thought that the C style format strings were unreadable and the 
> hex package methods were much clearer, personally. 
>
> —Sam 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4d600bee-5aae-454e-8419-cf6560af37bb%40googlegroups.com.

Reply via email to