pfug/hashing_test.go
2023-11-04 01:44:04 +01:00

28 lines
974 B
Go

package pfug
import "testing"
func TestGeneratePasswordHash(t *testing.T) {
salt := "deinemudda"
data := map[string]string{
"Password": "cGKb1Be4yuzMd7a9QvT44S6L2BGhITO+aPr/+UFGGPo=",
"123456": "bjk1U38vPhtzK8qYPiXZjt5fC+TL54abusiFWrS0wZ4=",
"123456789": "965RL3Lgmg937xr5cQS/hUCgGUFnefK+aDo9njkiB8Y=",
"12345678": "xfjWifoI42EcgTlEgT3f77PEaCKFVSt28xdRU7X+vqE=",
"1234567": "CIJ2+YHX+GHMGH5lUCNFh98RfvCJvIp5qYbRjjgwsEI=",
"Password1": "3KcQBn4On5Y7w6czkGqER0NCiaYaizTbKCFs2PnvJIo=",
"12345": "etxQ0tUR8o54IORWZghoWm+d6tUr5hWiXBzy6Jq6D1U=",
"1234567890": "NTlWzKkkfmNU7sWw4gFg+kxHNaOXdsvpV58eHog+t7I=",
"1234": "nPvFpMaXCkQmr2+mn79wKaqi7eSifngm16D65xeil6Q=",
"Qwerty123": "kifb3o+E7CZLA0rDtR0Vyv5jU5LtScyR+OeFB2mqeMw=",
}
for d, expectedResult := range data {
result := generatePasswordHash(d, salt)
if result != expectedResult {
t.Errorf("\ngot: %q\nwanted: %q\nfor: %q", result, expectedResult, d)
}
}
}