aboutsummaryrefslogtreecommitdiff
path: root/verify/core/crypt_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'verify/core/crypt_test.go')
-rw-r--r--verify/core/crypt_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/verify/core/crypt_test.go b/verify/core/crypt_test.go
new file mode 100644
index 0000000..5ea42d6
--- /dev/null
+++ b/verify/core/crypt_test.go
@@ -0,0 +1,21 @@
+package core
+
+import "testing"
+
+func TestCalculateStringHash(t *testing.T) {
+ got, err := calculateStringHash("hello")
+ want := "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d"
+
+ if got != want || err != nil {
+ t.Errorf("got %s, wanted %s", got, want)
+ }
+}
+
+func TestCalculateBlockHash(t *testing.T) {
+ got, err := CalculateBlockHash([]byte("hello"))
+ want := "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d"
+
+ if got != want || err != nil {
+ t.Errorf("got %s, wanted %s", got, want)
+ }
+}