basen

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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