This is a creation in Article, where the information may have evolved or changed.
Package Mainimport ("FMT" "math") var base = []string {"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", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}func base62encode (num int) string { BASESTR: = "" For {if num <= 0 {break} i: = num% basestr + = Base[i] num = (num-i)/base62} return Basestr}func Base62decode (base62 string) int {rs: = 0 Len: = Len () F: = Flip (base) for I: = 0; i < Len; i++ {rs + f[string (Base62[i]) * INT (math. Pow (Float64 (i))} return Rs}func Flip (s []string) map[string]int {f: = Make (Map[string]int) for index, V Alue: = range s {f[value] = index} return f}func main () {m: = Base62encode (12645354) fmt. Println (m) fmt. Println (Base62decode (m))}