| 1 |
hex: hexadecimal encoding and decoding support |
| 2 |
|
| 3 |
A stream-based encoding and decoding interface is available via [[newencoder]] |
| 4 |
and [[newdecoder]], which transparently encode or decode bytes to or from |
| 5 |
hexadecimal representation when writing to or reading from an underlying I/O |
| 6 |
handle. |
| 7 |
|
| 8 |
Convenience functions for encoding a byte slice into a hexadecimal string or |
| 9 |
decoding from a string into a byte slice are also available; see [[encodestr]] |
| 10 |
and [[decodestr]]. These functions dynamically allocate their return values; use |
| 11 |
the stream interface if you require static allocation. |
| 12 |
|
| 13 |
Note that writes are always encoded as lowercase hexadecimal characters, but the |
| 14 |
functions in this module can decode both upper- and lower-case hexadecimal |
| 15 |
characters. |