We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50f1329 commit 4d58821Copy full SHA for 4d58821
hnix-store-core/src/System/Nix/Internal/Hash.hs
@@ -97,6 +97,10 @@ hashLazy :: forall a.HasDigest a => BSL.ByteString -> Digest a
97
hashLazy bsl =
98
finalize $ foldl' (update @a) (initialize @a) (BSL.toChunks bsl)
99
100
+-- | Hash file
101
+hashFile :: forall a.HasDigest a => FilePath -> IO (Digest a)
102
+hashFile fp = hashLazy <$> BSL.readFile fp
103
+
104
digestText32 :: forall a. HashAlgoText a => Digest a -> T.Text
105
digestText32 d = algoString (Proxy :: Proxy a) <> ":" <> printAsBase32 d
106
0 commit comments