Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ASCII = &asciiEncoder{}
)
View Source
var ( // ASCIIHexToBytes is an encoder that converts ASCII Hex-digits into a byte slice // This encoder is used in TagSpec, BerTLVTag and similar. // It shouldn't be used with String, Numeric or Binary fields as packing and unpacking // in these fields uses length of value/bytes, so only Unpack will be able to read // the value correctly. // If you are looking for a way to work with HEX strings, use Hex field instead. ASCIIHexToBytes = &asciiToHexEncoder{} )
ASCII To HEX encoder
View Source
var (
BCD = &bcdEncoder{}
)
View Source
var (
BerTLVTag = &berTLVEncoderTag{}
)
View Source
var (
Binary = &binaryEncoder{}
)
View Source
var ( // BytesToASCIIHex is an encoder that converts bytes into their ASCII // representation. On success, the ASCII representation bytes are returned // Don't use this encoder with String, Numeric or Binary fields as packing and // unpacking in these fields uses length of value/bytes, so only Pack will be // able to write the value correctly. BytesToASCIIHex = &hexToASCIIEncoder{} )
HEX to ASCII encoder
View Source
var (
EBCDIC = &ebcdicEncoder{}
)
View Source
var EBCDIC1047 = &ebcdic1047Encoder{ encoder: charmap.CodePage1047.NewEncoder(), decoder: charmap.CodePage1047.NewDecoder(), }
EBCDIC1047 is an encoder for EBCDIC characters using IBM Code Page 1047.
View Source
var (
LBCD = &lBCDEncoder{}
)
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder interface {
// Encode encodes source data (ASCII, characters, digits, etc.) into
// destination bytes. It returns encoded bytes and any error
Encode([]byte) ([]byte, error)
// Decode decodes data into bytes (ASCII, characters, digits,
// etc.). It returns the bytes representing the decoded data, the
// number of bytes read from the input, and any error
Decode([]byte, int) (data []byte, read int, err error)
}
Click to show internal directories.
Click to hide internal directories.