Skip to content

lwydyby/bcrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bcrypt

Usage:

 go get github.com/lwydyby/bcrypt

code example

func TestCheckPwd(t *testing.T) {
	flag := CheckPw("123456", "$2b$12$u5ZBnqIpuoCCu31Ai0f3uugdJVD/FqwaJUDSiqaHvgeZY5Qy0XVMq")
	assert.Equal(t, true, flag)
}

func TestGenPwd(t *testing.T) {
	salt := GenSalt("$2b", 12)
	pwd := HashPw("123456", salt)
	fmt.Println(pwd)
	flag := CheckPw("123456", pwd)
	assert.Equal(t, true, flag)

}

About

Support 2B, 2Y mode encryption

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages