feat:优化项目信息
This commit is contained in:
@ -56,10 +56,14 @@ func HashCompare(src, compare []byte) bool {
|
||||
}
|
||||
|
||||
// HASHIDEncode 混淆
|
||||
func HASHIDEncode(src int) string {
|
||||
func HASHIDEncode(src int, minLength ...int) string {
|
||||
hd := hashids.NewData()
|
||||
hd.Salt = salt
|
||||
hd.MinLength = 12
|
||||
|
||||
if len(minLength) > 0 {
|
||||
hd.MinLength = minLength[0]
|
||||
}
|
||||
h := hashids.NewWithData(hd)
|
||||
e, _ := h.Encode([]int{src})
|
||||
return e
|
||||
|
Reference in New Issue
Block a user