From 98d56f40efb94e629d2ca02db833b3e70c38536f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Thu, 20 May 2021 22:40:24 +0200 Subject: [PATCH] NewUID only a-zA-Z0-9 chars. --- internal/utils/uid.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/utils/uid.go b/internal/utils/uid.go index 0f4216a..821722e 100644 --- a/internal/utils/uid.go +++ b/internal/utils/uid.go @@ -7,7 +7,7 @@ import ( ) const ( - defaultAlphabet = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // len=64 + defaultAlphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // len=62 defaultSize = 21 defaultMaskSize = 5 ) @@ -92,7 +92,7 @@ func NewUID(param ...int) (string, error) { } id := make([]byte, size) for i := 0; i < size; i++ { - id[i] = defaultAlphabet[bytes[i]&63] + id[i] = defaultAlphabet[bytes[i]&61] } return string(id[:size]), nil }