encoding

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package encoding provides encoding utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64StringToByteArray

func Base64StringToByteArray(input string) []byte

New: Base64StringToByteArray

func ByteArrayToBase64String

func ByteArrayToBase64String(input []byte) string

New: ByteArrayToBase64String

func Concat

func Concat(a, b []byte) []byte

Concat returns the concatenation of the two input byte strings.

func Concat3

func Concat3(a, b, c []byte) []byte

Concat3 returns the concatenation of the three input byte strings.

func Concatenate

func Concatenate(input ...[]byte) []byte

Concatenate takes the variadic array of input and returns a concatenation of it.

func DecodeVector

func DecodeVector(in []byte) (data []byte, offset int, err error)

DecodeVector returns the byte-slice of length indexed in the first two bytes.

func EncodeVector

func EncodeVector(input []byte) []byte

EncodeVector returns the input with a two-byte encoding of its length.

func EncodeVectorLen

func EncodeVectorLen(input []byte, length int) []byte

EncodeVectorLen returns the input prepended with a byte encoding of its length.

func I2OSP

func I2OSP(value, length int) []byte

I2OSP 32-bit Integer to Octet Stream Primitive on maximum 4 bytes.

func OS2IP

func OS2IP(input []byte) int

OS2IP Octet Stream to Integer Primitive on maximum 4 bytes / 32 bits.

func SuffixString

func SuffixString(a []byte, b string) []byte

SuffixString returns the concatenation of the input byte string and the string argument.

Types

This section is empty.

Jump to

Keyboard shortcuts

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