add hash ids provider

This commit is contained in:
yanghao05
2023-05-30 10:59:16 +08:00
parent 7d6b29c47d
commit 2523e47840
4 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package hashids
import (
"github.com/rogeecn/atom/container"
"github.com/rogeecn/atom/providers/http"
"github.com/rogeecn/atom/utils/opt"
)
const DefaultPrefix = "HashIDs"
func DefaultProvider() container.ProviderContainer {
return container.ProviderContainer{
Provider: Provide,
Options: []opt.Option{
opt.Prefix(http.DefaultPrefix),
},
}
}
type Config struct {
Salt string
MinLength uint
}