Closed GoogleCodeExporter closed 9 years ago
If this were to go in primitives, UnsignedBytes would probably be the correct
place. Anyway, if support for hex encoding/decoding is added to Guava it'll be
in the form of a more general binary encoding/decoding supporting hex, base64,
etc.
Original comment by cgdecker@google.com
on 10 Sep 2012 at 4:39
I don't know how signedness plays a role here, but UnsignedBytes sounds fine
anyway.
I'm going to do my Mr Obvious:
Base 16 is very commonly used for human-readable representation of binary data
(including hashes). One of the nice properties is that each byte takes exactly
two characters. It's also really helpful to display hashes.
Base 64 is more complex and AFAICT mostly used for compact, machine-readable
ASCII representation.
Not sure what would go into "etc." but I guess none of the other encodings
would be nearly as commonly used, or straightforward to implement.
Original comment by pie...@spotify.com
on 10 Sep 2012 at 5:07
For hashes, the HashCode objects produced by our hashing package have a
toString() that returns the hex form of the bytes. You can wrap a byte array as
a HashCode directly using HashCodes.fromBytes(byte[]).
Original comment by cgdecker@google.com
on 10 Sep 2012 at 7:07
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:13
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
pie...@spotify.com
on 10 Sep 2012 at 2:48Attachments: