|
|
|
@ -5,11 +5,13 @@ import (
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var StrTool Str
|
|
|
|
|
|
|
|
|
|
|
|
func TestHexEncode(t *testing.T) {
|
|
|
|
func TestHexEncode(t *testing.T) {
|
|
|
|
fmt.Println(HexEncode("hello world!"))
|
|
|
|
fmt.Println(StrTool.HexEncode("hello world!"))
|
|
|
|
//68656c6c6f20776f726c6421
|
|
|
|
//68656c6c6f20776f726c6421
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func TestHexDecode(t *testing.T) {
|
|
|
|
func TestHexDecode(t *testing.T) {
|
|
|
|
fmt.Println(HexDecode("68656c6c6f20776f726c6421"))
|
|
|
|
fmt.Println(StrTool.HexDecode("68656c6c6f20776f726c6421"))
|
|
|
|
//hello world! <nil>
|
|
|
|
//hello world! <nil>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|