Last active
September 11, 2021 14:26
-
-
Save iyear/5e0715c7d869414e04879d0e259b9825 to your computer and use it in GitHub Desktop.
HDUHelp HealthCheck Sign
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getSign(staffName string, staffID int64, ts int64, province int, city int, country int) string { | |
s := staffName + | |
base64.StdEncoding.EncodeToString([]byte(strconv.FormatInt(staffID, 10))) + | |
strconv.FormatInt(ts, 10) + | |
base64.StdEncoding.EncodeToString([]byte(strconv.Itoa(province))) + | |
strconv.Itoa(city) + | |
strconv.Itoa(country) | |
return SHA1(s) | |
} | |
func SHA1(s string) string { | |
o := sha1.New() | |
o.Write([]byte(s)) | |
return hex.EncodeToString(o.Sum(nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment