format

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package format implements useful string/byte formatting functions.

Package format implements useful string/byte formatting functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HexDump

func HexDump(data []byte, opts ...Options) string

HexDump produces a wireshark-like hexdump, with an option to set the left and right delimiter used for the ascii section. This is a cheesy implementation using a regex to change the golang hexdump output.

func MakeEscapedString

func MakeEscapedString(data []byte) string

func MakeHexStream

func MakeHexStream(data []byte) string

func MakePrintableString

func MakePrintableString(data []byte) string

func MakePrintableStringWithNewlines

func MakePrintableStringWithNewlines(data []byte) string

func TranslateHexCodes

func TranslateHexCodes(s []byte) []byte

TranslateHexCodes will change instances of "\x41" in the input to the byte 'A' in the output, passing through other characters. This is a small subset of strconv.Unquote() for wireshark PSML data.

Types

type Options

type Options struct {
	LeftAsciiDelimiter  string
	RightAsciiDelimiter string
}

Jump to

Keyboard shortcuts

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