pad

package
v0.0.0-...-835eb37 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Padder

type Padder interface {
	Pad(data []byte, msgSize int) []byte
}

Padder is something able to apply padding to message.

type PadderFunc

type PadderFunc func(data []byte, msgSize int) []byte

PadderFunc is function which is Padder.

func (PadderFunc) Pad

func (f PadderFunc) Pad(data []byte, msgSize int) []byte

Pad makes PadderFunc satisfy Padder.

type Padding

type Padding interface {
	Padder
	Unpadder
}

Padding is something, which gets messsage and makes it constant length. It's also able to reverse it.

func IEC78164Padding

func IEC78164Padding() Padding

IEC78164Padding is single padding scheme, which has simple format: [any, any, any..., 0x80, 0x00, 0x00, 0x00...].

type Unpadder

type Unpadder interface {
	// Unpad returns value < 0 if it failed
	Unpad(data []byte) (msgSize int)
}

Unpadder is something able to remove padding.

type UnpadderFunc

type UnpadderFunc func(data []byte) (msgSize int)

UnpadderFunc if cuntion which is Unpadder.

func (UnpadderFunc) Unpad

func (f UnpadderFunc) Unpad(data []byte) (msgSize int)

Unpad makes UnpadderFunc satisfy Unpadder.

Jump to

Keyboard shortcuts

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