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.
16 lines
346 B
16 lines
346 B
package service
|
|
|
|
import "testing"
|
|
|
|
func TestPasswordEncrypt(t *testing.T) {
|
|
user_id := 1678546894123654781
|
|
src := "DouTokNo1@"
|
|
salt := GenSalt()
|
|
|
|
password1 := PasswordEncrypt(int64(user_id), src, salt)
|
|
password2 := PasswordEncrypt(int64(user_id), src, salt)
|
|
|
|
if password1 != password2 {
|
|
panic("加密方案不能保证结果一致")
|
|
}
|
|
}
|
|
|