Namespace: go.std.encoding.hex
v1.0Contents
Summary
Provides a low-level interface to the encoding/hex package.
Package hex implements hexadecimal encoding and decoding.
Index
- *InvalidByteError
- Decode
- DecodeString
- DecodedLen
- Dump
- Dumper
- Encode
- EncodeToString
- EncodedLen
- ErrLength
- InvalidByteError
- NewDecoder
- NewEncoder
- arrayOfInvalidByteError
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
ErrLength
Var v1.0ErrLength reports an attempt to decode an odd-length input
using Decode or DecodeString.
The stream-based Decoder returns io.ErrUnexpectedEOF instead of ErrLength.
Functions, Macros, and Special Forms
-
Decode
Function v1.0(Decode dst src)
Decode decodes src into DecodedLen(len(src)) bytes,
returning the actual number of bytes written to dst.
Decode expects that src contains only hexadecimal
characters and that src has even length.
If the input is malformed, Decode returns the number
of bytes decoded before the error.
Go input arguments: (dst []byte, src []byte)
Go returns: (int, error)
Joker input arguments: [^arrayOfByte dst, ^arrayOfByte src]
Joker returns: [^Int, ^Error] -
DecodeString
Function v1.0(DecodeString s)
DecodeString returns the bytes represented by the hexadecimal string s.
DecodeString expects that src contains only hexadecimal
characters and that src has even length.
If the input is malformed, DecodeString returns
the bytes decoded before the error.
Go input arguments: (s string)
Go returns: ([]byte, error)
Joker input arguments: [^String s]
Joker returns: [^arrayOfByte, ^Error] -
DecodedLen
Function v1.0(DecodedLen x)
DecodedLen returns the length of a decoding of x source bytes.
Specifically, it returns x / 2.
Go input arguments: (x int)
Go returns: int
Joker input arguments: [^Int x]
Joker returns: ^Int -
Dump
Function v1.0(Dump data)
Dump returns a string that contains a hex dump of the given data. The format
of the hex dump matches the output of `hexdump -C` on the command line.
Go input arguments: (data []byte)
Go returns: string
Joker input arguments: [^arrayOfByte data]
Joker returns: ^String -
Dumper
Function v1.0(Dumper w)
Dumper returns a WriteCloser that writes a hex dump of all written data to
w. The format of the dump matches the output of `hexdump -C` on the command
line.
Go input arguments: (w io.Writer)
Go returns: io.WriteCloser
Joker input arguments: [^go.std.io/Writer w]
Joker returns: ^go.std.io/WriteCloser -
Encode
Function v1.0(Encode dst src)
Encode encodes src into EncodedLen(len(src))
bytes of dst. As a convenience, it returns the number
of bytes written to dst, but this value is always EncodedLen(len(src)).
Encode implements hexadecimal encoding.
Go input arguments: (dst []byte, src []byte)
Go returns: int
Joker input arguments: [^arrayOfByte dst, ^arrayOfByte src]
Joker returns: ^Int -
EncodeToString
Function v1.0(EncodeToString src)
EncodeToString returns the hexadecimal encoding of src.
Go input arguments: (src []byte)
Go returns: string
Joker input arguments: [^arrayOfByte src]
Joker returns: ^String -
EncodedLen
Function v1.0(EncodedLen n)
EncodedLen returns the length of an encoding of n source bytes.
Specifically, it returns n * 2.
Go input arguments: (n int)
Go returns: int
Joker input arguments: [^Int n]
Joker returns: ^Int -
NewDecoder
Function v1.0(NewDecoder r)
NewDecoder returns an io.Reader that decodes hexadecimal characters from r.
NewDecoder expects that r contain only an even number of hexadecimal characters.
Go input arguments: (r io.Reader)
Go returns: io.Reader
Joker input arguments: [^go.std.io/Reader r]
Joker returns: ^go.std.io/Reader -
NewEncoder
Function v1.0(NewEncoder w)
NewEncoder returns an io.Writer that writes lowercase hexadecimal characters to w.
Go input arguments: (w io.Writer)
Go returns: io.Writer
Joker input arguments: [^go.std.io/Writer w]
Joker returns: ^go.std.io/Writer
Types
-
*InvalidByteError
Concrete Type v1.0InvalidByteError values describe errors resulting from an invalid byte in a hex string.
-
InvalidByteError
Concrete Type v1.0InvalidByteError values describe errors resulting from an invalid byte in a hex string.
-
Error
Receiver for InvalidByteError v1.0([])
-
arrayOfInvalidByteError
Concrete Type v1.0InvalidByteError values describe errors resulting from an invalid byte in a hex string.