encoding

package
v0.38.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ByteSize = 8
	// Encoding follows Croford's Base 32 https://www.crockford.com/base32.html
	Encoding = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"
)

Variables

View Source
var ErrInvalidString = errors.New("String contains invalid characters")

Functions

func Btoi16

func Btoi16(val []byte) uint16

func Btoi32

func Btoi32(val []byte) uint32

func Btoi64

func Btoi64(val []byte) uint64

func I16tob

func I16tob(val uint16) []byte

func I32tob

func I32tob(val uint32) []byte

func I64tob

func I64tob(val uint64) []byte

func MarshalBase32 added in v0.16.0

func MarshalBase32(a []byte) string

func UnmarshalBase32 added in v0.16.0

func UnmarshalBase32(encoded string) ([]byte, error)

Types

type Base64

type Base64 []byte

Base64 is a []byte base64 encoded value.

func ParseBase64 added in v0.34.0

func ParseBase64(data string) (Base64, error)

func (Base64) AsString added in v0.34.0

func (m Base64) AsString() string

func (Base64) MarshalJSON

func (m Base64) MarshalJSON() ([]byte, error)

MarshalJSON returns m as a base64 encoding of m.

func (Base64) String

func (m Base64) String() string

func (*Base64) UnmarshalJSON

func (m *Base64) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a decoded base64.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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