[add sha1Handle, which takes the hash of an already open file handle
John Meacham <john@repetae.net>**20070608214947] hunk ./Util/SHA1.hs 28
-module Util.SHA1 (sha1file,ABCDE(..),Hash) where
+module Util.SHA1 (sha1file,sha1Handle,ABCDE(..),Hash) where
hunk ./Util/SHA1.hs 46
-{-# NOINLINE sha1file #-}
-sha1file :: FilePath -> IO Hash
-sha1file fp = do
-    h   <- openBinaryFile fp ReadMode
+{-# NOINLINE sha1Handle #-}
+sha1Handle :: Handle -> IO Hash
+sha1Handle h = do
+    hSeek h AbsoluteSeek 0
hunk ./Util/SHA1.hs 64
+{-# NOINLINE sha1file #-}
+sha1file :: FilePath -> IO Hash
+sha1file fp = do
+    h   <- openBinaryFile fp ReadMode
+    hash <- sha1Handle h
+    hClose h
+    return hash
+