base62

package
v0.0.0-...-85b3fc2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var B62StdEncoding = NewEncoding("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")

B62StdEncoding is the standard base64 encoding, as defined in RFC 4648.

Functions

func NewDecoder

func NewDecoder(enc *B62Encoding, r io.Reader) io.Reader

NewDecoder constructs a new base64 stream decoder.

func NewEncoder

func NewEncoder(enc *B62Encoding, w io.Writer) io.WriteCloser

NewEncoder returns a new base64 stream encoder. Data written to the returned writer will be encoded using enc and then written to w. Base64 encodings operate in 4-byte blocks; when finished writing, the caller must Close the returned encoder to flush any partially written blocks.

Types

type B62Encoding

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

func NewEncoding

func NewEncoding(encoder string) *B62Encoding

func (*B62Encoding) AppendEncode

func (enc *B62Encoding) AppendEncode(dst, src []byte) []byte

AppendEncode appends the base64 encoded src to dst and returns the extended buffer.

func (*B62Encoding) Decode

func (enc *B62Encoding) Decode(dst, src []byte) (n int, err error)

func (*B62Encoding) DecodeString

func (enc *B62Encoding) DecodeString(s string) ([]byte, error)

DecodeString returns the bytes represented by the base64 string s.

func (*B62Encoding) DecodedLen

func (enc *B62Encoding) DecodedLen(n int) int

DecodedLen returns the maximum length in bytes of the decoded data corresponding to n bytes of base64-encoded data.

func (*B62Encoding) Encode

func (enc *B62Encoding) Encode(dst, src []byte)

func (*B62Encoding) EncodeToString

func (enc *B62Encoding) EncodeToString(src []byte) string

EncodeToString returns the base64 encoding of src.

func (*B62Encoding) EncodedLen

func (enc *B62Encoding) EncodedLen(n int) int

EncodedLen returns the length in bytes of the base64 encoding of an input buffer of length n.

type CorruptInputError

type CorruptInputError int64

func (CorruptInputError) Error

func (e CorruptInputError) Error() string

Jump to

Keyboard shortcuts

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