-
Notifications
You must be signed in to change notification settings - Fork 7
/
verushash.go
40 lines (34 loc) · 1.05 KB
/
verushash.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
31
32
33
34
35
36
37
38
39
40
package verushash
import (
"github.com/asherda/go-verushash/verushash"
"unsafe"
)
// Initialize verushash object once.
var verusHash = VH.NewVerushash()
func VerusHash(serializedHeader []byte) []byte {
hash := make([]byte, 32)
ptrHash := uintptr(unsafe.Pointer(&hash[0]))
length := len(serializedHeader)
verusHash.Verushash(string(serializedHeader), length, ptrHash)
return hash
}
func VerusHash_V2B(serializedHeader []byte) []byte {
hash := make([]byte, 32)
ptrHash := uintptr(unsafe.Pointer(&hash[0]))
length := len(serializedHeader)
verusHash.Verushash_v2b(string(serializedHeader), length, ptrHash)
return hash
}
func VerusHash_V2B1(serializedHeader []byte) []byte {
hash := make([]byte, 32)
ptrHash := uintptr(unsafe.Pointer(&hash[0]))
length := len(serializedHeader)
verusHash.Verushash_v2b1(string(serializedHeader), length, ptrHash)
return hash
}
func VerusHash_V2B2(serializedHeader []byte) []byte {
hash := make([]byte, 32)
ptrHash := uintptr(unsafe.Pointer(&hash[0]))
verusHash.Verushash_v2b2(string(serializedHeader), ptrHash)
return hash
}