basen

package
v0.0.0-...-b09c24f Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlphabetBase16 = "1234567890abcdef"
	AlphabetBase62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	AlphabetBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseNDecoder

type BaseNDecoder struct {
	// contains filtered or unexported fields
}

BaseNDecoder is a generic base-N decoder.

func NewBaseNDecoder

func NewBaseNDecoder(alphabet string) *BaseNDecoder

NewBaseNDecoder creates a new instance of BaseNDecoder using the provided alphabet.

func (*BaseNDecoder) Decode

func (d *BaseNDecoder) Decode(data string) ([]byte, error)

Decode decodes the string base-N data into bytes and returns any error that might have occurred.

type BaseNEncoder

type BaseNEncoder struct {
	// contains filtered or unexported fields
}

BaseNEncoder is a generic base-N encoder.

func NewBaseNEncoder

func NewBaseNEncoder(alphabet string) *BaseNEncoder

NewBaseNEncoder creates a new instance of BaseNEncoder using the provided alphabet.

func (*BaseNEncoder) Encode

func (e *BaseNEncoder) Encode(data []byte) string

Encode encodes the binary data into base-64 encoded strings.

Jump to

Keyboard shortcuts

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