https://github.com/osamingo/base58
Package base58 implements encoding and decoding of base58
https://github.com/osamingo/base58
base58 decoder encoder go
Last synced: 5 months ago
JSON representation
Package base58 implements encoding and decoding of base58
- Host: GitHub
- URL: https://github.com/osamingo/base58
- Owner: osamingo
- License: mit
- Created: 2021-02-01T09:02:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T17:11:56.000Z (7 months ago)
- Last Synced: 2025-04-20T13:36:22.108Z (6 months ago)
- Topics: base58, decoder, encoder, go
- Language: Go
- Homepage: https://pkg.go.dev/github.com/osamingo/base58
- Size: 8.79 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# base58
[](https://github.com/osamingo/base58/actions?query=workflow%3ACI)
[](https://codecov.io/gh/osamingo/Base58)
[](https://goreportcard.com/report/github.com/osamingo/base58)
[](https://pkg.go.dev/github.com/osamingo/base58)
[](https://github.com/osamingo/base58/blob/main/LICENSE)## About
This `base58` package implements Logic optimized for unsigned int64.
## Install
```shell
$ go get -u github.com/osamingo/bae58
```## Usage
```go
package mainimport (
"log""github.com/osamingo/base58"
)func main() {
enc, err := base58.NewEncoder(base58.StandardSource)
if err != nil {
log.Fatal("failed to generate base58.Encoder", err)
}src := uint64(9223372036854775808)
dst := enc.Encode(src)log.Println(dst)
// Output: NQm6nKp8qFDret, err := enc.Decode(dst)
if err != nil {
log.Fatal("failed to decode, dst = "+dst, err)
}log.Println(ret)
// Output: 9223372036854775808
}
```## Benchmark
```
# Machine: MacBook Pro (13-inch, 2018, Four Thunderbolt 3 Ports)
# CPU : 2.7 GHz Intel Core i7
# Memory : 16 GB 2133 MHz LPDDR3goos: darwin
goarch: amd64
pkg: github.com/osamingo/base58
BenchmarkEncoder_Encode-8 15775299 71.5 ns/op 46 B/op 1 allocs/op
BenchmarkEncoder_Decode-8 36928071 29.8 ns/op 0 B/op 0 allocs/op
PASS
```## License
Released under the [MIT License](https://github.com/osamingo/base58/blob/main/LICENSE).