2 lab
Application / application (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Quzzqq
2026-10-23 16:31:42 +03:00
parent 65003b6119
commit cbb92b7aef
36 changed files with 3268 additions and 23 deletions
+19
View File
@@ -0,0 +1,19 @@
package authpw
import "testing"
func TestHashVerifiesOnlyTheSamePassword(t *testing.T) {
encoded, err := Hash("correct-horse-battery")
if err != nil {
t.Fatal(err)
}
if !Verify("correct-horse-battery", encoded) {
t.Fatal("same password rejected")
}
if Verify("correct-horse-batteries", encoded) {
t.Fatal("other password accepted")
}
if Verify("correct-horse-battery", "sha256:nope") {
t.Fatal("foreign encoding accepted")
}
}