🎨 添加图库和客服插件(有问题-待修改)
This commit is contained in:
27
test/rain_test.go
Normal file
27
test/rain_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
"math/rand"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRain(t *testing.T) {
|
||||
rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
verifyCode := fmt.Sprintf("%06v", rand.Int31n(1000000))
|
||||
fmt.Println(verifyCode)
|
||||
}
|
||||
|
||||
func TestPwd(t *testing.T) {
|
||||
password, _ := bcrypt.GenerateFromPassword([]byte("loser7659"), bcrypt.DefaultCost)
|
||||
fmt.Println(string(password))
|
||||
|
||||
err := bcrypt.CompareHashAndPassword(password, []byte("122456"))
|
||||
if err != nil {
|
||||
fmt.Println("密码错误")
|
||||
} else {
|
||||
fmt.Println("密码正确")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user