base91

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package base91 implements base91 encoding, fork from https://github.com/mtraver/base91

Index

Constants

This section is empty.

Variables

View Source
var StdEncoding = newEncoding(encodeStd)

StdEncoding is the standard base91 encoding (that is, the one specified at http://base91.sourceforge.net). Of the 95 printable ASCII characters, the following four are omitted: space (0x20), apostrophe (0x27), hyphen (0x2d), and backslash (0x5c).

Functions

This section is empty.

Types

type Encoding

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

An Encoding is a base 91 encoding/decoding scheme defined by a 91-character alphabet.

func (*Encoding) Decode

func (enc *Encoding) Decode(dst, src []byte) (int, error)

Decode decodes src using the encoding enc. It writes at most DecodedLen(len(src)) bytes to dst and returns the number of bytes written. If src contains invalid base91 data, it will return the number of bytes successfully written and CorruptInputError.

func (*Encoding) DecodedLen

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

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

func (*Encoding) Encode

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

Encode encodes src using the encoding enc, writing bytes to dst. It returns the number of bytes written, because the exact output size cannot be known before encoding takes place. EncodedLen(len(src)) may be used to determine an upper bound on the output size when allocating a dst slice.

func (*Encoding) EncodedLen

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

EncodedLen returns an upper bound on the length in bytes of the base91 encoding of an input buffer of length n. The true encoded length may be shorter.

Jump to

Keyboard shortcuts

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