babble

package
v0.0.0-...-e6da677 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2013 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package babble implements Bubble Babble encoding and decoding, as specified by http://wiki.yak.net/589.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

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

Decode decodes a Babble string into the corresponding byte array. Returns the number of bytes decoded, and an error if the string isn't a Babble string. Once Decode encounters a Babble data terminator in the src data, it stops decoding and returns the number of bytes read, regardless of whether there is more data remaining.

func DecodeString

func DecodeString(src string) (result []byte, err error)

DecodeString decodes a babble string, returning the resulting byte array.

func Encode

func Encode(dst, src []byte) int

Encode encodes src into EncodedLen(len(src)) bytes of dst as Bubble Babble code.

func EncodeToString

func EncodeToString(src []byte) string

EncodeToString returns the Bubble Babble encoding of src.

func EncodedLen

func EncodedLen(n int) int

EncodeLen returns the number of bytes an encoded n bytes will take.

func MaxDecodedLen

func MaxDecodedLen(n int) int

MaxDecodedLen returns the maximum number of bytes a decoding of a Babble string of length n will take. There may be a difference of one byte in the result length for the same input length depending on the content.

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