Documentation ¶
Overview ¶
Package base91 implements a base91 encoder and decoder.
base91 is defined in Joachim Henke's basE91: http://base91.sourceforge.net/
Example ¶
package main import ( "fmt" "ekyu.moe/base91" ) func main() { fmt.Println(base91.EncodeToString([]byte("Hello, 世界"))) fmt.Println(string(base91.DecodeString(">OwJh>}AFU~PUh%Y"))) }
Output: >OwJh>}AFU~PUh%Y Hello, 世界
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var (
EmailLineWrap = 76
)
Functions ¶
func Decode ¶
Decode decodes src into dst. It returns the number of bytes written to dst. Whereas base91 uses up to nearly all printable characters, Decode skips invalid characters silently.
func DecodeString ¶
DecodeString returns the bytes represented by the base91 string s, probably what you want.
func EncodeToString ¶
EncodeToString returns the encoded base91 string of src, probably what you want.
func NewDecoder ¶
NewDecoder constructs a new base91 stream decoder. Data read from the returned reader is base91 decoded from r.
func NewEncoder ¶
func NewEncoder(w io.Writer) io.WriteCloser
NewEncoder returns a new base91 stream encoder. Data written to the returned writer will be encoded using base91 and then written to w. When finished writing, the caller must Close the returned encoder to flush any partially written blocks.
func NewLineWrapper ¶ added in v0.2.0
func NewLineWrapper(w io.Writer, cols int) io.WriteCloser
NewLineWrapper returns an base91 encoeder that encode data and insert CRLF every cols characters. This is useful for emails.
Types ¶
This section is empty.