refactor(nanoid): replace gonanoid with custom nanoid implementation for ID generation

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2026-03-13 21:06:26 -04:00
parent 55e10b9c77
commit d042fc138c
6 changed files with 141 additions and 7 deletions
+2 -2
View File
@@ -6,12 +6,12 @@ import (
"math/big"
"strings"
gonanoid "github.com/matoous/go-nanoid/v2"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/utils/nanoid"
)
func NewRandom() string {
id, err := gonanoid.Generate("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 22)
id, err := nanoid.Generate("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 22)
if err != nil {
log.Error("Could not generate new ID", err)
}