Skip to content

Equim-chan/base91-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7e4bd9d Β· Dec 12, 2017

History

21 Commits
Dec 3, 2017
Sep 1, 2017
Sep 1, 2017
Sep 1, 2017
Dec 12, 2017
Dec 8, 2017
Dec 12, 2017
Dec 12, 2017
Dec 8, 2017
Dec 12, 2017
Dec 8, 2017
Dec 8, 2017
Sep 2, 2017
Sep 2, 2017

Repository files navigation

base91-go

Travis Go Report Card Release License GoDoc

basE91 codec implemented in Golang.

Migrated from the C and PHP version of Joachim Henke's basE91.

Nodejs version

Install

$ go get -u ekyu.moe/base91

Example

package main

import (
    "fmt"

    "ekyu.moe/base91"
)

func main() {
    fmt.Println(base91.EncodeToString([]byte("Hello, δΈ–η•Œ"))) //=> >OwJh>}AFU~PUh%Y
    fmt.Println(string(base91.DecodeString(">OwJh>}AFU~PUh%Y"))) //=> Hello, δΈ–η•Œ
}

Check godoc for further documents.

A CLI utility is also available with go get ekyu.moe/base91/cmd/base91.

Benchmark

Note: 1 op = 1 MB input

$ go test --bench . --benchmem ekyu.moe/base91
goos: windows
goarch: amd64
pkg: ekyu.moe/base91
BenchmarkDecode-4            200           6484956 ns/op         7157760 B/op         36 allocs/op
BenchmarkDecoder-4           200           8789155 ns/op         146.71 MB/s     2136691 B/op      2465 allocs/op
BenchmarkEncode-4            300           7264316 ns/op         8673280 B/op         37 allocs/op
BenchmarkEncoder-4           200           7149004 ns/op         146.67 MB/s     2808690 B/op         2 allocs/op
PASS

License

BSD-3-clause

About

πŸ”‘ basE91 codec in pure Golang implementation.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages