A Bijective Encoding Function implementation, useful for URL shorteners.
go get github.com/leonardoeloy/bijectiv
package main
import (
"github.com/leonardoeloy/bijectiv"
"fmt"
)
func main() {
b := bijectiv.New()
fmt.Printf("Encoded value of 100 is %s\n", b.Encode(100))
fmt.Printf("Decoded value of 'bM' is %d\n", b.Decode("bM"))
b = bijectiv.NewAlphabet("MYRESTRICTEDALPHABET")
fmt.Printf("Encoded value of 100 with custom alphabet is %s\n", b.Encode(100))
}