diff --git a/go.sum b/go.sum index 5809af4..75996cf 100644 --- a/go.sum +++ b/go.sum @@ -89,8 +89,6 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gagliardetto/binary v0.4.4 h1:EeADyw6t/5+/8Dtdt8LZ2X8Kd0vDJW0XXDi5iUgrFrc= -github.com/gagliardetto/binary v0.4.4/go.mod h1:peJR9PvwamL4YOh1nHWCPLry2VEfeeD1ADvewka7HnQ= github.com/gagliardetto/binary v0.5.0 h1:fLVIbMEQp5zbW0SFtg0z/WHy2iUw/SMeuakzfa5ayhI= github.com/gagliardetto/binary v0.5.0/go.mod h1:peJR9PvwamL4YOh1nHWCPLry2VEfeeD1ADvewka7HnQ= github.com/gagliardetto/gofuzz v1.2.2 h1:XL/8qDMzcgvR4+CyRQW9UGdwPRPMHVJfqQ/uMvSUuQw= diff --git a/nativetypes.go b/nativetypes.go index cf9bd8d..9e2032a 100644 --- a/nativetypes.go +++ b/nativetypes.go @@ -43,6 +43,10 @@ func HashFromBase58(in string) (Hash, error) { return Hash(tmp), nil } +func HashFromBytes(in []byte) Hash { + return Hash(PublicKeyFromBytes(in)) +} + func (ha Hash) MarshalJSON() ([]byte, error) { return json.Marshal(base58.Encode(ha[:])) }