Skip to content

leonardoeloy/bijectiv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bijectiv Build Status GoDoc

A Bijective Encoding Function implementation, useful for URL shorteners.

Installation

go get github.com/leonardoeloy/bijectiv

Usage

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))
}

About

A library for URL shortener encoding/decoding in Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages