You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
533 B
Go
29 lines
533 B
Go
/**
|
|
* @Author: jager
|
|
* @Email: lhj168os@gmail.com
|
|
* @File: utils
|
|
* @Date: 2021/12/31 4:41 下午
|
|
* @package: utils
|
|
* @Version: v1.0.0
|
|
*
|
|
* @Description:
|
|
*
|
|
*/
|
|
|
|
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/jageros/hawox/encrypt"
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
func GenSecret(uid string) string {
|
|
return encrypt.Sha1(fmt.Sprintf("%s%d%d", uid, time.Now().Unix(), rand.Intn(99999999)+100))
|
|
}
|
|
|
|
func GenSecretMd5(uid string) string {
|
|
return encrypt.Md5(fmt.Sprintf("%s%d%d", uid, time.Now().Unix(), rand.Intn(99999999)+100))
|
|
}
|