mirror of https://github.com/perkeep/perkeep.git
blob: add RefFromString
Change-Id: I1e98874fd43c1570c2e79907dbdbc7e44ca64bf7
This commit is contained in:
parent
abdfd02bbb
commit
0dfaad41a7
|
@ -298,6 +298,12 @@ func RefFromHash(h hash.Hash) Ref {
|
|||
return Ref{meta.ctor(h.Sum(nil))}
|
||||
}
|
||||
|
||||
// RefFromString returns a blobref from the given string, for the currently
|
||||
// recommended hash function
|
||||
func RefFromString(s string) Ref {
|
||||
return SHA1FromString(s)
|
||||
}
|
||||
|
||||
// SHA1FromString returns a SHA-1 blobref of the provided string.
|
||||
func SHA1FromString(s string) Ref {
|
||||
s1 := sha1.New()
|
||||
|
|
Loading…
Reference in New Issue