summaryrefslogtreecommitdiff
path: root/src/Storage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Storage.hs')
-rw-r--r--src/Storage.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Storage.hs b/src/Storage.hs
index a306206..25c7a75 100644
--- a/src/Storage.hs
+++ b/src/Storage.hs
@@ -116,9 +116,11 @@ instance BA.ByteArrayAccess Ref where
zeroRef :: Storage -> Ref
zeroRef s = Ref s h
- where h = case digestFromByteString $ B.replicate (BA.length h) 0 of
+ where h = case digestFromByteString $ B.replicate (hashDigestSize $ digestAlgo h) 0 of
Nothing -> error $ "Failed to create zero hash"
Just h' -> h'
+ digestAlgo :: Digest a -> a
+ digestAlgo = undefined
isZeroRef :: Ref -> Bool
isZeroRef (Ref _ h) = all (==0) $ BA.unpack h