Thanks to visit codestin.com
Credit goes to pkg.go.dev

base45

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: BSD-3-Clause Imports: 2 Imported by: 6

README

Base45 library for Go Go Reference License

Implemented https://datatracker.ietf.org/doc/draft-faltstrom-base45/

Heavily copied out code from std lib encoding/base64

Documentation

Overview

Package base45 implements base45 encoding as specified by draft-faltstrom-base45-06.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

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

func DecodeString

func DecodeString(s string) ([]byte, error)

DecodeString returns the bytes represented by the base45 string s.

func DecodedLen

func DecodedLen(n int) int

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

func Encode

func Encode(dst, src []byte)

Encode encodes src using the encoding enc, writing EncodedLen(len(src)) bytes to dst.

The encoding pads the output to a multiple of 3 bytes, so Encode is not appropriate for use on individual blocks of a large data stream. Use NewEncoder() instead.

func EncodeToString

func EncodeToString(src []byte) string

EncodeToString returns the base45 encoding of src.

func EncodedLen

func EncodedLen(n int) int

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

func NewDecoder

func NewDecoder(r io.Reader) io.Reader

NewDecoder constructs a new base45 stream decoder.

func NewEncoder

func NewEncoder(w io.Writer) io.WriteCloser

NewEncoder returns a new base45 stream encoder. Base45 encodings operate in 3-byte blocks; when finished writing, the caller must Close the returned encoder to flush any partially written blocks.

Types

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