Add metainfo.NewHashFromHex

This commit is contained in:
Matt Joiner 2016-06-21 02:35:53 +10:00
parent ce0a3d56f1
commit 364f617ade
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ func (h *Hash) FromHexString(s string) (err error) {
return
}
func NewHashFromHex(s string) (h Hash) {
h.FromHexString(s)
return
}
func HashBytes(b []byte) (ret Hash) {
hasher := sha1.New()
hasher.Write(b)