aboutsummaryrefslogtreecommitdiff
path: root/verify/core/crypt_test.go
blob: 5ea42d61b52f652efcdbce331437c23c89c3dd50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)
	}
}