func Decode(s string) (string, error) {
	bi, err := DecodeInt(s)
	if err != nil {
		return "", err
	}
	return bi.String(), nil
}
Decode converts the alpha id to big integer
package alpha
import (
	"math/big"
	"strconv"
	"unicode"
	"github.com/pkg/errors"
)
var (
	dictionary = []byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}
	base       *big.Int
	dictMap    map[byte]*big.Int
)
func init() {
	base = big.NewInt(int64(len(dictionary)))
	dictMap = make(map[byte]*big.Int)
	j := 0
	for _, val := range dictionary {
		dictMap[val] = big.NewInt(int64(j))
		j = j + 1
	}
}
func isValidNumeric(s string) bool {
	for _, r := range s {
		if !unicode.IsNumber(r) {
			return false
		}
	}
	return true
}
func isAsciiPrintable(s string) bool {
	for _, r := range s {
		if r > unicode.MaxASCII || !unicode.IsPrint(r) || unicode.IsPunct(r) {
			return false
		}
	}
	return true
}
func encodeInt(remaining *big.Int) (string, error) {
	var result []byte
	var index int
	var strVal string
	a := big.NewInt(0)
	b := big.NewInt(0)
	c := big.NewInt(0)
	d := big.NewInt(0)
	exponent := 1
	for remaining.Cmp(big.NewInt(0)) != 0 {
		a.Exp(base, big.NewInt(int64(exponent)), nil)  
		b = b.Mod(remaining, a)                        
		c = c.Exp(base, big.NewInt(int64(exponent-1)), nil)
		d = d.Div(b, c)
		strVal = d.String()
		index, _ = strconv.Atoi(strVal)
		result = append(result, dictionary[index])
		remaining = remaining.Sub(remaining, b)  
		exponent = exponent + 1
	}
	return string(reverse(result)), nil
}
func EncodeInt(i *big.Int) (string, error) {
	remaining := big.NewInt(0)
	remaining.Set(i)
	return encodeInt(remaining)
}
func Encode(s string) (string, error) {
	if !isValidNumeric(s) {
		return "", errors.New("Encode string is not a valid numeric")
	}
	remaining := big.NewInt(0)
	remaining.SetString(s, 10)
	return encodeInt(remaining)
}
func DecodeInt(s string) (*big.Int, error) {
	if !isAsciiPrintable(s) {
		return nil, errors.New("Decode string is not valid.[a-z, A_Z, 0-9] only allowed")
	}
	chars2 := reverse([]byte(s))
	bi := big.NewInt(0)
	exponent := 0
	a := big.NewInt(0)
	b := big.NewInt(0)
	intermed := big.NewInt(0)
	for _, c := range chars2 {
		a = dictMap[c]
		intermed = intermed.Exp(base, big.NewInt(int64(exponent)), nil)
		b = b.Mul(intermed, a)
		bi = bi.Add(bi, b)
		exponent = exponent + 1
	}
	return bi, nil
}