matthewdu / base62

uint64 <=> base62

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

base62

CircleCI

Convert to and from uint64 into base62 string. Useful for shortening long integer IDs. I personally use for Google Cloud Datastore IDs.

Install

go get -u github.com/matthewdu/base62

Test (with benchmark)

go test -benchmem -bench .

Use

var n uint64 = 3781504209452600
s := base62.Encode(n) // hjNv8tS3K 
m, _ := base62.Decode(s) // 3781504209452600

About

uint64 <=> base62


Languages

Language:Go 100.0%