1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
This commit is contained in:
2022-05-06 17:29:35 +08:00
parent 25af24d7c0
commit cd0740f443
12 changed files with 102 additions and 6 deletions

View File

@ -7,8 +7,19 @@ import (
"testing"
"github.com/charlienet/go-mixed/hash"
"github.com/charlienet/go-mixed/rand"
"github.com/stretchr/testify/assert"
)
func TestHashComplie(t *testing.T) {
abc, err := hash.New("MD5")
if err != nil {
}
b, _ := hex.DecodeString(rand.Hex.Generate(16))
assert.False(t, abc.Verify([]byte("source"), b))
}
func TestEncode(t *testing.T) {
t.Log(hash.Sha1([]byte{0x31}).Base64())
t.Log(hash.Sha1([]byte{0x31}).Hex())