You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
447 B

package crypto
import (
"fmt"
"testing"
)
var cryptoTool Crypto
func TestMd5(tt *testing.T) {
fmt.Println(cryptoTool.Md5Encode("hello world!"))
//fc3ff98e8c6a0d3087d515c0473f8677
fmt.Println(cryptoTool.Md5Check("hello world!", "fc3ff98e8c6a0d3087d515c0473f8677"))
//true
}
func TestCrypto_Md5EncodeFile(t *testing.T) {
filePath := "./md5.go"
fmt.Println(cryptoTool.Md5EncodeFile(filePath))
//fea07bd54d5c1841a682b408fbbb0cf8 <nil>
}