chore: upgrade dependencies and secure passwords
This commit is contained in:
13
module/ec/mall/internal/password/password_test.go
Normal file
13
module/ec/mall/internal/password/password_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package password
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestHashAndVerify(t *testing.T) {
|
||||
hash, err := Hash("correct horse battery staple")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !Verify(hash, "correct horse battery staple") || Verify(hash, "wrong") {
|
||||
t.Fatal("bcrypt verification failed")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user