https://github.com/equim-chan/base91-go
π‘ basE91 codec in pure Golang implementation.
https://github.com/equim-chan/base91-go
base91 binary-to-text decoding encoding
Last synced: about 1 year ago
JSON representation
π‘ basE91 codec in pure Golang implementation.
- Host: GitHub
- URL: https://github.com/equim-chan/base91-go
- Owner: Equim-chan
- License: bsd-3-clause
- Created: 2017-09-01T06:11:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-12T07:33:03.000Z (over 8 years ago)
- Last Synced: 2025-04-04T20:47:11.376Z (about 1 year ago)
- Topics: base91, binary-to-text, decoding, encoding
- Language: Go
- Size: 26.4 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base91-go
[](https://travis-ci.org/Equim-chan/base91-go)
[](https://goreportcard.com/report/github.com/Equim-chan/base91-go)
[](https://github.com/Equim-chan/base91-go/releases/latest)
[](https://github.com/Equim-chan/base91-go/blob/master/LICENSE)
[](https://godoc.org/ekyu.moe/base91)
basE91 codec implemented in Golang.
Migrated from the C and PHP version of Joachim Henke's [basE91](http://base91.sourceforge.net/).
[Nodejs version](https://github.com/Equim-chan/base91)
## Install
```bash
$ go get -u ekyu.moe/base91
```
## Example
```go
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](https://godoc.org/ekyu.moe/base91) for further documents.
A CLI utility is also available with `go get ekyu.moe/base91/cmd/base91`.
## Benchmark
Note: 1 op = 1 MB input
```plain
$ 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](https://github.com/Equim-chan/base91-go/blob/master/LICENSE)