aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/hash/hash.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/hash/hash.go')
-rw-r--r--plumbing/hash/hash.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plumbing/hash/hash.go b/plumbing/hash/hash.go
index 80e4b5f..82d1856 100644
--- a/plumbing/hash/hash.go
+++ b/plumbing/hash/hash.go
@@ -21,6 +21,7 @@ func init() {
// that registers new algorithms to avoid side effects.
func reset() {
algos[crypto.SHA1] = sha1cd.New
+ algos[crypto.SHA256] = crypto.SHA256.New
}
// RegisterHash allows for the hash algorithm used to be overriden.
@@ -34,6 +35,8 @@ func RegisterHash(h crypto.Hash, f func() hash.Hash) error {
switch h {
case crypto.SHA1:
algos[h] = f
+ case crypto.SHA256:
+ algos[h] = f
default:
return fmt.Errorf("unsupported hash function: %v", h)
}