From 790f51ef13b4d0fdcecba3b00407bc30ab7736d2 Mon Sep 17 00:00:00 2001 From: pupilcc Date: Sun, 9 Jun 2024 20:08:51 +0800 Subject: [PATCH] feat: id remove symbol --- common/util/id.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/util/id.go b/common/util/id.go index 6e92d94..6ed6d5e 100644 --- a/common/util/id.go +++ b/common/util/id.go @@ -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 ""