接口开发

This commit is contained in:
2025-02-25 16:57:59 +08:00
parent 76ccd57fbc
commit 32ba6262cc
48 changed files with 2468 additions and 466 deletions

View File

@ -35,6 +35,19 @@ func NewInvite() *IntToStr {
}
}
// NewInvite 数字邀请码
func NewNumberInvite() *IntToStr {
return &IntToStr{
SALT: 15151239, // 随意取一个数值
Len: 9, // 邀请码长度
PRIME2: 3, // 与邀请码长度 Len 互质
AlphanumericSet: []rune{
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
}, // 邀请码长度
PRIME1: 3, // 与字符集长度 10 互质
}
}
func (in IntToStr) DeCode(codeStr string) int {
code := make([]rune, 0, in.Len)
var key rune = 0