1{-# LANGUAGE BangPatterns #-}
2import Control.Monad (forM)
3import qualified Crypto.Hash.SHA256 as SHA256
4import qualified Data.ByteString.Base16 as Base16
5import qualified Data.ByteString.Char8 as BS8
6import qualified Data.ByteString.Lazy as BSL
8import qualified Data.Map as Map
10import System.FilePath ((</>))
12type FileHashes = Map Identifier String
14mkFileHashes :: FilePath -> IO FileHashes
16 allFiles <- getRecursiveContents (\_ -> return False) dir
17 fmap Map.fromList $ forM allFiles $ \path0 -> do
18 let path1 = dir </> path0
20 return (fromFilePath path1, h)
22 hash :: FilePath -> IO String
24 !h <- SHA256.hashlazy <$> BSL.readFile fp
25 return $! BS8.unpack $! Base16.encode h
29 fileHashes <- preprocess (mkFileHashes "images")
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list