feat:优化项目信息

This commit is contained in:
henry
2022-02-15 17:19:23 +08:00
parent cbc0ad1a41
commit dcb5948e91
45 changed files with 852 additions and 100 deletions

View File

@ -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