z85

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 3 Imported by: 12

README

Go (golang) implementation of ZeroMQ Base-85 encoding as specified by http://rfc.zeromq.org/spec:32/Z85

Documentation: http://godoc.org/github.com/tilinna/z85

Documentation

Overview

Package z85 implements ZeroMQ Base-85 encoding as specified by http://rfc.zeromq.org/spec:32/Z85

Index

Constants

This section is empty.

Variables

View Source
var ErrLength = errors.New("z85: wrongly aligned input data")

ErrLength results from encoding or decoding wrongly aligned input data.

Functions

func Decode

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

Decode decodes z85 encoded src into DecodedLen(len(src)) bytes of dst, returning the number of bytes written to dst, always DecodedLen(len(src)). The len(src) must be divisible by 5, otherwise an ErrLength is returned. If Decode encounters invalid input bytes, it returns an InvalidByteError.

func DecodedLen

func DecodedLen(n int) int

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

func Encode

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

Encode encodes src into EncodedLen(len(src)) bytes of dst using z85 encoding, returning the number of bytes written to dst, always EncodedLen(len(src)). The len(src) must be divisible by 4, otherwise an ErrLength is returned.

func EncodedLen

func EncodedLen(n int) int

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

Types

type InvalidByteError

type InvalidByteError byte

InvalidByteError values describe errors resulting from an invalid byte in a z85 encoded data.

func (InvalidByteError) Error

func (e InvalidByteError) Error() string

Jump to

Keyboard shortcuts

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