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.
26 lines
831 B
26 lines
831 B
package crypto
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestCrypto_Md5Hmac(t *testing.T) {
|
|
fmt.Println(cryptoTool.Md5Hmac("hello world!", "123456"))
|
|
//0869302654295f1e6100539678192559
|
|
fmt.Println(cryptoTool.Md5String("hello world!"))
|
|
//fc3ff98e8c6a0d3087d515c0473f8677
|
|
fmt.Println(cryptoTool.Md5Hmac("hello world!", ""))
|
|
//3ce504dbfc6f5834fc52371727877f85
|
|
|
|
}
|
|
|
|
func TestCrypto_ShaHmac(t *testing.T) {
|
|
fmt.Println(cryptoTool.Sha1Hmac("hello world!", "123456"))
|
|
//397d14b5c064f1f3a19c2e8d1f5108d797a47a3c
|
|
fmt.Println(cryptoTool.Sha256Hmac("hello world!", "123456"))
|
|
//03c6198ea823af32c338b1524d1653ccc065c06af916495a178208189555d428
|
|
fmt.Println(cryptoTool.Sha512Hmac("hello world!", "123456"))
|
|
//8a432b00e63bbca7fe42d75d2517724af89f0d5404b42b828adbbcb87b1916e73c3a4186adab399ba636aee431ee35a238e75e87f29583189ca1502d3da9885e
|
|
}
|