Skip to content

Commit

Permalink
feat: id remove symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
pupilcc committed Jun 9, 2024
1 parent 96e389e commit 790f51e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/util/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package util

import gonanoid "github.com/matoous/go-nanoid/v2"

const ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

func GenerateID() string {
if id, err := gonanoid.New(12); err == nil {
if id, err := gonanoid.Generate(ALPHABET, 12); err == nil {
return id
}
return ""
Expand Down

0 comments on commit 790f51e

Please sign in to comment.