加密
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
297 B

package crypter
import (
"crypto/hmac"
"fmt"
"golang.org/x/crypto/ripemd160"
)
func EncryptedToken(token, key string) string {
h2 := hmac.New(ripemd160.New, []byte(key))
h2.Write([]byte(token))
hashBytes := h2.Sum(nil)
hashString := fmt.Sprintf("%x", hashBytes)
return hashString
}