Skip to content

Commit

Permalink
NewUID only a-zA-Z0-9 chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed May 20, 2021
1 parent 70c9dc2 commit 98d56f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/utils/uid.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const (
defaultAlphabet = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // len=64
defaultAlphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // len=62
defaultSize = 21
defaultMaskSize = 5
)
Expand Down Expand Up @@ -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
}

0 comments on commit 98d56f4

Please sign in to comment.