Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Fill = '.'
Functions ¶
This section is empty.
Types ¶
type Dump ¶
type Dump []byte
Dump at memory layout representation of an object
func NewDump ¶
func NewDump(o interface{}) Dump
NewDump return a dump object. o may be any primitive type or pointer to any other object type.
func (Dump) Chars ¶
Chars produce a string that represents the dump as a string of characters, one character per byte. fill is used for characters that do not have a graphic representation. latin1 determines if high characters should be used to represent bytes.
func (Dump) Format ¶
Format support for "fmt" package Printf functions.
supported formatter verbs: ``` s output bytes as ASCII characters, one character per byte. ASCII control characters or characters outside the 7 bit
range are displayed as '.'.
x print dump as compact string of hex digits, width supported. b represent bytes in the dump with eight binary digits. o represent bytes in the dump with three octal digits. d represent bytes in the dump with three decimal digits. x represent bytes in the dump with two hex digits. ```
supported formatter flags: ``` # include latin1 characters in the output - remove ascii display from hexdump 0 zero-fill bytes ```
The format precision for `%b`, `%o`, `%d` and `%x` specifies the number of bytes output per line.
func (Dump) Stringify ¶
Stringify produce a hex-dump string from a dump object, d. Each line will being with an address followed by each byte. if c is true, the ascii representation of the preceding bytes will follow. latin1 will allow latin1 characters in the output string. littledian will output grouped bytes in little-endian order. bcount controls the number of bytes output on each line of the hex-dump. if zerofill is true, each byte will be filled in with leading zeros.