Add metainfo.NewHashFromHex
This commit is contained in:
parent
ce0a3d56f1
commit
364f617ade
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue