diff --git a/routes/routes.go b/routes/routes.go index 65f88f2..e0b017b 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -48,7 +48,7 @@ func Encode(c *gin.Context) { hasher := sha512.New() hasher.Write([]byte(URL.Long.String)) base := base64.StdEncoding.EncodeToString(hasher.Sum(nil)) - i := 1 + i := 2 for { database.Db.Model(&database.URL{}).Where("short = ?", base[0:i]).Count(&count) if count > 0 && i < len(base) {