-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathltc_scrypt_go_test.go
30 lines (27 loc) · 1.04 KB
/
ltc_scrypt_go_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package ltc_scrypt_go
import (
"encoding/hex"
"fmt"
"testing"
)
func TestCalcScryptHash(t *testing.T) {
// "0000000110c8357966576df46f3b802ca897deb7ad18b12f1c24ecff6386ebd9"
b1, _ := hex.DecodeString("01000000f615f7ce3b4fc6b8f61e8f89aedb1d0852507650533a9e3b10b9bbcc30639f279fcaa86746e1ef52d3edb3c4ad8259920d509bd073605c9bf1d59983752a6b06b817bb4ea78e011d012d59d4")
b1h := CalcScryptHash(b1)
b1r := make([]byte, len(b1h))
for i := 0; i < len(b1h); i++ {
b1r[i] = b1h[len(b1h)-i-1]
}
fmt.Println("b1r: ", hex.EncodeToString(b1r))
}
func TestCalcScryptHashHex(t *testing.T) {
// "0000000110c8357966576df46f3b802ca897deb7ad18b12f1c24ecff6386ebd9"
b1, _ := hex.DecodeString("01000000f615f7ce3b4fc6b8f61e8f89aedb1d0852507650533a9e3b10b9bbcc30639f279fcaa86746e1ef52d3edb3c4ad8259920d509bd073605c9bf1d59983752a6b06b817bb4ea78e011d012d59d4")
b1hHex := CalcScryptHashHex(b1)
b1h, _ := hex.DecodeString(b1hHex)
b1r := make([]byte, len(b1h))
for i := 0; i < len(b1h); i++ {
b1r[i] = b1h[len(b1h)-i-1]
}
fmt.Println("b1r: ", hex.EncodeToString(b1r))
}