uu

package
v0.0.1-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

README

UU

Simple library for uuencoding/uudecoding.

Tests

See testdata/README.md for more information.

Documentation

Overview

Package uu - Simple uuencode/uudecode

This package provides simple uuencoding and uudecoding. It is compatible with Perl's pack/unpack "u" template. See https://perldoc.perl.org/functions/pack for more details.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDataLen = errors.New(
	"encoded data not a multiple of four characters",
)

ErrInvalidDataLen indicates the data part of the line was not a multiple of four characters.

Functions

func AppendDecode

func AppendDecode(dst, src []byte) ([]byte, error)

AppendDecode decodes src, appends it to dst, and returns the extended buffer.

func AppendEncode

func AppendEncode(dst, src []byte) []byte

AppendEncode encodes src, appends it to dst, and returns the extended buffer.

func MaxDecodedLen

func MaxDecodedLen(b []byte) int

MaxDecodedLen eeturns a maximum number of bytes of the decoded form of b as required by AppendDecode. Accuracy is traded for O(1) execution; in practice AppendDecode will usuallu require less space.

func MaxEncodedLen

func MaxEncodedLen(b []byte) int

MaxEncodedLen eeturns a maximum number of bytes of the encoded form of b as required by AppendEncode. Accuracy is traded for O(1) execution; in practice AppendEncode will usuallu require less space.

Types

type DecodeError

type DecodeError struct {
	Line, Offset int   /* Where the error occured. */
	Err          error /* What happened. */
}

DecodeError indicates where in the encoded data decoding failed.

func (DecodeError) Error

func (err DecodeError) Error() string

Error implements the error interface.

func (DecodeError) Unwrap

func (err DecodeError) Unwrap() error

Unwrap returns err.Err.

type IncorrectDataLenError

type IncorrectDataLenError struct {
	Expected int
	Actual   int
}

IncorrectDataLenError indicates the data part of the line was inconsistent with the length character.

func (IncorrectDataLenError) Error

func (err IncorrectDataLenError) Error() string

Error implements the error interface.

type InvalidEncodedCharacterError

type InvalidEncodedCharacterError rune

InvalidEncodedCharacterError indicates a line contained an invalid character.

func (InvalidEncodedCharacterError) Error

Error implements the error interface.

type InvalidLengthCharacterError

type InvalidLengthCharacterError rune

InvalidLengthCharacterError indicates a line's length (first) character indicated a length less than 0.

func (InvalidLengthCharacterError) Error

func (err InvalidLengthCharacterError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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