aboutsummaryrefslogtreecommitdiffstats
path: root/internal/hash.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2015-10-27 01:49:58 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2015-10-27 01:49:58 +0100
commit7d6c5a56c0b63705378f125523876de1a97fd1ce (patch)
tree8945a8a02d53f36a64304beaf006c4f46d61da48 /internal/hash.go
parenta2e49a59782a50a9ff116c6d17c6e3888502f2ad (diff)
downloadgo-git-7d6c5a56c0b63705378f125523876de1a97fd1ce.tar.gz
tree and commit
Diffstat (limited to 'internal/hash.go')
-rw-r--r--internal/hash.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/hash.go b/internal/hash.go
index db55b24..0540db1 100644
--- a/internal/hash.go
+++ b/internal/hash.go
@@ -30,6 +30,11 @@ func NewHash(s string) Hash {
return h
}
+func (h Hash) IsZero() bool {
+ var empty Hash
+ return h == empty
+}
+
func (h Hash) String() string {
return hex.EncodeToString(h[:])
}