A streaming base62 encoder in a few different languages
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
base62.go
base62_test.go

README.md

Base62 Encoder/Decoder

a Go library to encode and decode byte streams to a base62 encoding.

Roughly based on parts of A Secure, Lossless, and Compressed Base62 Encoding, the encoding scheme does not use the traditional approach requiring a lot of modulo math and is therefore considerably more efficient with minimal loss in compression (~0.28%).

Base62 is an encoding that is mostly associated with URL shorteners. It is much like the widely used Base64 encoding, but constrains the character set to just the 62 alphanumeric characters.

Installation & Use

go get github.com/kellegous/base62

The encoder and decoder have APIs very similar to the one used by most Go encoding libraries (including base64).