Module: stdgo.encoding.hex
Overview
Index
-
function decode(_dst:Array<UInt>, _src:Array<UInt>):stdgo.Tuple<Int, stdgo.Error>
-
function decodeString(_s:String):stdgo.Tuple<Array<UInt>, stdgo.Error>
-
function dumper(_w:stdgo._internal.io.Writer):stdgo._internal.io.WriteCloser
-
function newDecoder(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
-
function newEncoder(_w:stdgo._internal.io.Writer):stdgo._internal.io.Writer
-
function testDecodeString(_t:stdgo._internal.testing.T_):Void
-
function testDecodeStringErr(_t:stdgo._internal.testing.T_):Void
-
function testDumper_doubleclose(_t:stdgo._internal.testing.T_):Void
-
function testDumper_earlyclose(_t:stdgo._internal.testing.T_):Void
-
function testEncodeToString(_t:stdgo._internal.testing.T_):Void
-
function testEncoderDecoder(_t:stdgo._internal.testing.T_):Void
Variables
import stdgo.encoding.hex.Hex
var errLength:stdgo.Error
Classes
import stdgo.encoding.hex.*
class Hex
Package hex implements hexadecimal encoding and decoding.
Hex function benchmarkDecode
function benchmarkDecode(_b:stdgo._internal.testing.B):Void
Hex function benchmarkDump
function benchmarkDump(_b:stdgo._internal.testing.B):Void
Hex function benchmarkEncode
function benchmarkEncode(_b:stdgo._internal.testing.B):Void
Hex function decode
function decode(_dst:Array<UInt>, _src:Array<UInt>):stdgo.Tuple<Int, stdgo.Error>
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.
Hex function decodeString
function decodeString(_s:String):stdgo.Tuple<Array<UInt>, stdgo.Error>
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.
Hex function decodedLen
function decodedLen(_x:Int):Int
DecodedLen returns the length of a decoding of x source bytes.
Specifically, it returns x / 2.
Hex function dump
function dump(_data:Array<UInt>):String
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.
Hex function dumper
function dumper(_w:stdgo._internal.io.Writer):stdgo._internal.io.WriteCloser
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.
Hex function encode
function encode(_dst:Array<UInt>, _src:Array<UInt>):Int
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.
Hex function encodeToString
function encodeToString(_src:Array<UInt>):String
EncodeToString returns the hexadecimal encoding of src.
Hex function encodedLen
function encodedLen(_n:Int):Int
EncodedLen returns the length of an encoding of n source bytes.
Specifically, it returns n * 2.
Hex function newDecoder
function newDecoder(_r:stdgo._internal.io.Reader):stdgo._internal.io.Reader
NewDecoder returns an io.Reader that decodes hexadecimal characters from r.
NewDecoder expects that r contain only an even number of hexadecimal characters.
Hex function newEncoder
function newEncoder(_w:stdgo._internal.io.Writer):stdgo._internal.io.Writer
NewEncoder returns an io.Writer that writes lowercase hexadecimal characters to w.
Hex function testDecode
function testDecode(_t:stdgo._internal.testing.T_):Void
Hex function testDecodeErr
function testDecodeErr(_t:stdgo._internal.testing.T_):Void
Hex function testDecodeString
function testDecodeString(_t:stdgo._internal.testing.T_):Void
Hex function testDecodeStringErr
function testDecodeStringErr(_t:stdgo._internal.testing.T_):Void
Hex function testDecoderErr
function testDecoderErr(_t:stdgo._internal.testing.T_):Void
Hex function testDump
function testDump(_t:stdgo._internal.testing.T_):Void
Hex function testDumper
function testDumper(_t:stdgo._internal.testing.T_):Void
Hex function testDumper_doubleclose
function testDumper_doubleclose(_t:stdgo._internal.testing.T_):Void
Hex function testDumper_earlyclose
function testDumper_earlyclose(_t:stdgo._internal.testing.T_):Void
Hex function testEncode
function testEncode(_t:stdgo._internal.testing.T_):Void
Hex function testEncodeToString
function testEncodeToString(_t:stdgo._internal.testing.T_):Void
Hex function testEncoderDecoder
function testEncoderDecoder(_t:stdgo._internal.testing.T_):Void
Typedefs
import stdgo.encoding.hex.*
typedef InvalidByteError
typedef InvalidByteError = stdgo._internal.encoding.hex.InvalidByteError;
typedef T__struct_0
typedef T__struct_0 = stdgo._internal.encoding.hex.T__struct_0;
typedef T__struct_1
typedef T__struct_1 = stdgo._internal.encoding.hex.T__struct_1;
typedef T__struct_2
typedef T__struct_2 = stdgo._internal.encoding.hex.T__struct_2;