xxd

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package xxd implements the logic behind converting byte stream to hexadecimal dump. It can also convert a hexadecimal dump back to its original binary form. This functionality is otherwise provide by linux command line tool xxd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Driver

func Driver() int

Driver function to use the functionalities of this package

func InputParse

func InputParse(s []byte, offset int, f *ParsedFlags, length int) string

Function to parse the input stream of bytes.

func NewFlags

func NewFlags() (*Flags, *IsSetFlags, []string)

Function to parse flags from the command line.

Types

type Flags

type Flags struct {
	Endian    bool
	GroupSize string
	Length    string
	Columns   string
	Seek      string
	Revert    bool
}

Struct containing flag values as entered in the terminal.

e stands for little-endian output

g stands for Group-Size

l stands for the no of bytes to convert

c stands for columns to print each line

s stands for seek

r stands for reverting from hex dump to original file

type IsSetFlags

type IsSetFlags struct {
	IsSetG bool
	IsSetL bool
	IsSetC bool
	IsSetS bool
}

Struct to indicate whether a particular flag was used as options

type ParsedFlags

type ParsedFlags struct {
	IsFile bool
	E      bool
	G      int
	L      int
	S      int
	C      int
	R      bool
}

Struct containing parsed flag values from original values

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL