feat: remove v1

This commit is contained in:
Rogee
2024-12-04 14:11:50 +08:00
parent 0803c2f54f
commit cdf8acf78f
63 changed files with 314 additions and 2461 deletions

View File

@@ -17,7 +17,7 @@ func Provide(opts ...opt.Option) error {
data := hashids.NewData()
data.MinLength = int(config.MinLength)
if data.MinLength == 0 {
data.MinLength = 5
data.MinLength = 10
}
data.Salt = config.Salt
@@ -25,8 +25,9 @@ func Provide(opts ...opt.Option) error {
data.Salt = "default-salt-key"
}
if config.Alphabet != "" {
data.Alphabet = config.Alphabet
data.Alphabet = config.Alphabet
if config.Alphabet == "" {
data.Alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
}
return hashids.NewWithData(data)