mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
4e12271d79
Signed-off-by: kejiang <ke.jiang@zilliz.com> Co-authored-by: kejiang <ke.jiang@zilliz.com>
16 lines
416 B
Go
16 lines
416 B
Go
package crypto
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPasswordVerify(t *testing.T) {
|
|
wrongPassword := "test_my_name"
|
|
correctPassword := "test_my_pass_new"
|
|
hashedPass, _ := PasswordEncrypt(correctPassword)
|
|
assert.True(t, PasswordVerify(correctPassword, "$2a$10$3H9DLiHyPxJ29bMWRNyueOrGkbzJfE3BAR159ju3UetytAoKk7Ne2"))
|
|
assert.False(t, PasswordVerify(wrongPassword, hashedPass))
|
|
}
|