Minor update
This commit is contained in:
13
util.go
13
util.go
@ -6,6 +6,7 @@ import (
|
||||
"encoding/hex"
|
||||
_"fmt"
|
||||
_"math"
|
||||
"github.com/obscuren/sha3"
|
||||
)
|
||||
|
||||
func Uitoa(i uint32) string {
|
||||
@ -24,6 +25,14 @@ func Sha256Bin(data []byte) []byte {
|
||||
return hash[:]
|
||||
}
|
||||
|
||||
func Sha3Bin(data []byte) []byte {
|
||||
d := sha3.NewKeccak224()
|
||||
d.Reset()
|
||||
d.Write(data)
|
||||
|
||||
return d.Sum(nil)
|
||||
}
|
||||
|
||||
// Helper function for comparing slices
|
||||
func CompareIntSlice(a, b []int) bool {
|
||||
if len(a) != len(b) {
|
||||
@ -48,3 +57,7 @@ func MatchingNibbleLength(a, b []int) int {
|
||||
|
||||
return i
|
||||
}
|
||||
|
||||
func Hex(d []byte) string {
|
||||
return hex.EncodeToString(d)
|
||||
}
|
||||
|
Reference in New Issue
Block a user