* golint
* remove gitter badge
This commit is contained in:
Andrea Spacca
2021-08-19 22:45:30 +02:00
committed by GitHub
parent 788dfa203f
commit 9fe5f9a5c9
13 changed files with 251 additions and 162 deletions

View File

@ -29,12 +29,12 @@ import (
)
const (
// characters used for short-urls
// SYMBOLS characters used for short-urls
SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
)
// generate a token
func Token(length int) string {
func token(length int) string {
result := ""
for i := 0; i < length; i++ {
x := rand.Intn(len(SYMBOLS) - 1)