26 lines
319 B
Go
26 lines
319 B
Go
|
package crypto
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestMD5(t *testing.T) {
|
||
|
b := []byte("hello there")
|
||
|
h := MD5(b)
|
||
|
if h == "" {
|
||
|
t.Error("failed to hasg")
|
||
|
return
|
||
|
}
|
||
|
|
||
|
println(h)
|
||
|
}
|
||
|
|
||
|
func TestSha256(t *testing.T) {
|
||
|
b := []byte("hello there")
|
||
|
h := SHA256(b)
|
||
|
if h == "" {
|
||
|
t.Error("failed to hasg")
|
||
|
return
|
||
|
}
|
||
|
|
||
|
println(h)
|
||
|
}
|