Version 1.0.1
This commit is contained in:
commit
2fa1c028a7
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue