padding

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pad00

func Pad00(data []byte, blockSize int) ([]byte, error)

Pad00 pads the data with 0x00s until the data is an exact multiple of the block size. When the data size is already a multiple of the block size, nothing will be added. This is equivalent to ISO 9797-1 Padding Method 1.

func Pad00Extra

func Pad00Extra(data []byte, blockSize int) ([]byte, error)

Pad80Extra pads the data with 0x00s until the data is an exact multiple of the block size. When the data size is already a multiple of the block size, a new block will be added following the same rules.

func Pad80

func Pad80(data []byte, blockSize int) ([]byte, error)

Pad80 pads the data with byte 0x80 and then 0x00s until the data is an exact multiple of the block size. When the data size is already a multiple of the block size, nothing will be added. This is equivalent to ISO 9797-1 Padding Method 2.

func Pad80Extra

func Pad80Extra(data []byte, blockSize int) ([]byte, error)

Pad80Extra pads the data with byte 0x80 and then 0x00s until the data is an exact multiple of the block size. When the data size is already a multiple of the block size, a new block will be added following the same rules.

func PadOrTruncateRight

func PadOrTruncateRight(data []byte, length int) []byte

func PadOrTruncateRightWithByte

func PadOrTruncateRightWithByte(data []byte, length int, b byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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