GitXplorerGitXplorer
k

base62

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
f746fdee67528aff40c4d43439d4084b0b726103

feat(mod) rm dep artifacts

kkasperlewau committed 5 years ago
Unverified
b5cd84e3cf13d74b559af6f40b9507573233541b

chore(base62): align func style

kkasperlewau committed 7 years ago
Unverified
a23891eed4f0ed50de2cefbdc5c2039b29ab43de

chore(base62): remainder > rem, result > res

kkasperlewau committed 7 years ago
Unverified
8641fcdcd06eaca06faf5ef76b629c23f1701a73

chore(test): rm unused dep bytes

kkasperlewau committed 7 years ago
Unverified
ec40916a335723fa3bbb637f4952718492215c23

chore(README): add usage

kkasperlewau committed 7 years ago
Unverified
123cc4207e15a2b767d2b5c25e4919157cf6fba9

chore(base62_test): rm pilu tests

kkasperlewau committed 7 years ago

README

The README file for this repository.

base62 GoDoc Build Status Go Report Card

converts ints to byteslices/strings of base62 data and back again.

install

go get github.com/kasperlewau/base62

usage

import (
	"fmt"
	
	"github.com/kasperlewau/base62"
)

func main() {
	base62.Encode(99) // [49 66]
	base62.EncodeString(99) // "1B"

	base62.Decode([]byte("1B")) // 99
	base62.DecodeString("1B") // 99
}

benchmarks

goos: linux
goarch: amd64
pkg: github.com/kasperlewau/base62
BenchmarkEncoders/kasperlewau/bytes-8           30000000                34.7 ns/op             8 B/op          1 allocs/op
BenchmarkEncoders/kasperlewau/string-8          30000000                44.0 ns/op            16 B/op          1 allocs/op
BenchmarkEncoders/pilu/go-base62-8              30000000                43.5 ns/op            16 B/op          1 allocs/op
BenchmarkEncoders/marksalpeter/token-8          10000000               230 ns/op              39 B/op          2 allocs/op
BenchmarkDecoders/kasperlewau/bytes-8           50000000                32.9 ns/op             0 B/op          0 allocs/op
BenchmarkDecoders/kasperlewau/string-8          30000000                41.5 ns/op             0 B/op          0 allocs/op
BenchmarkDecoders/pilu/go-base62-8              10000000               175 ns/op              64 B/op          1 allocs/op
BenchmarkDecoders/marksalpeter/token-8          10000000               193 ns/op              64 B/op          1 allocs/op

license

MIT