summaryrefslogtreecommitdiff
path: root/src/Storage.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2019-05-05 13:37:01 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2019-05-06 21:05:50 +0200
commitdc67ee394205802d30d888387dffa7f588099217 (patch)
treef1fa51f2bb8b68c080d2430a07142d92a1035f30 /src/Storage.hs
parent637e70e9d61616e16cb845100538fe2cf4c7fb29 (diff)
Signed identities using ED25519
Diffstat (limited to 'src/Storage.hs')
-rw-r--r--src/Storage.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Storage.hs b/src/Storage.hs
index f9d302e..c31230e 100644
--- a/src/Storage.hs
+++ b/src/Storage.hs
@@ -107,6 +107,10 @@ data Ref = Ref Storage (Digest Blake2b_256)
instance Show Ref where
show ref@(Ref (Storage path) _) = path ++ ":" ++ BC.unpack (showRef ref)
+instance BA.ByteArrayAccess Ref where
+ length (Ref _ dgst) = BA.length dgst
+ withByteArray (Ref _ dgst) = BA.withByteArray dgst
+
zeroRef :: Storage -> Ref
zeroRef s = Ref s h
where h = case digestFromByteString $ B.replicate (BA.length h) 0 of