31 lines
487 B
Go
31 lines
487 B
Go
// Copyright 2024 Patial Tech (Ankit Patial).
|
|
//
|
|
// This file is part of code.patial.tech/go/appcore, which is MIT licensed.
|
|
// See http://opensource.org/licenses/MIT
|
|
|
|
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)
|
|
}
|