payload

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateUnpaddedSize

func CalculateUnpaddedSize(p *loadtime.Payload) (int, error)

CalculateUnpaddedSize calculates the size of the passed in payload for the purpose of determining how much padding to add to reach the target size. CalculateUnpaddedSize returns an error if the payload Padding field is longer than 1.

func FromBytes

func FromBytes(b []byte) (*loadtime.Payload, error)

FromBytes extracts a paylod from the byte representation of the payload. FromBytes leaves the padding untouched, returning it to the caller to handle or discard per their preference.

func MaxUnpaddedSize

func MaxUnpaddedSize() (int, error)

MaxUnpaddedSize returns the maximum size that a payload may be if no padding is included.

func NewBytes

func NewBytes(p *loadtime.Payload) ([]byte, error)

NewBytes generates a new payload and returns the encoded representation of the payload as a slice of bytes. NewBytes uses the fields on the Options to create the payload.

Types

This section is empty.

Jump to

Keyboard shortcuts

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