bytes

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT, Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuffer

func NewBuffer(call goja.ConstructorCall) interface{}

NewBuffer creates a new buffer from a byte slice.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer is a minimal buffer implementation over a byte slice that is used to pack/unpack binary data in nuclei js integration.

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

Bytes returns the byte slice of the buffer.

func (*Buffer) Hex

func (b *Buffer) Hex() string

Hex returns the hex representation of the buffer.

func (*Buffer) Hexdump

func (b *Buffer) Hexdump() string

Hexdump returns the hexdump representation of the buffer.

func (*Buffer) Len

func (b *Buffer) Len() int

Len returns the length of the buffer.

func (*Buffer) Pack

func (b *Buffer) Pack(formatStr string, msg []interface{}) error

Pack uses structs.Pack and packs given data and appends it to the buffer. it packs the data according to the given format.

func (*Buffer) String

func (b *Buffer) String() string

String returns the string representation of the buffer.

func (*Buffer) Write

func (b *Buffer) Write(data []byte) *Buffer

Write appends a byte slice to the buffer.

func (*Buffer) WriteString

func (b *Buffer) WriteString(data string) *Buffer

WriteString appends a string to the buffer.

Jump to

Keyboard shortcuts

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