From 0dfaad41a76600ac61f0c3ae423ec5459764cfaf Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 25 Oct 2013 00:22:10 -0700 Subject: [PATCH] blob: add RefFromString Change-Id: I1e98874fd43c1570c2e79907dbdbc7e44ca64bf7 --- pkg/blob/ref.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/blob/ref.go b/pkg/blob/ref.go index d0b488c26..55ba4f2c3 100644 --- a/pkg/blob/ref.go +++ b/pkg/blob/ref.go @@ -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()