darcs-2.18.2: a distributed, interactive, smart revision control system
Safe HaskellNone
LanguageHaskell2010

Darcs.Util.ValidHash

Synopsis

Documentation

class (Eq h, IsSizeHash h) => ValidHash h where #

External API for the various hash types.

Minimal complete definition

dirofValidHash

Methods

dirofValidHash :: h -> HashedDir #

The HashedDir belonging to this type of hash

calcValidHash :: ByteString -> h #

Compute hash from file content.

data PatchHash #

Instances

Instances details
Show PatchHash # 
Instance details

Defined in Darcs.Util.ValidHash

ValidHash PatchHash # 
Instance details

Defined in Darcs.Util.ValidHash

Eq PatchHash # 
Instance details

Defined in Darcs.Util.ValidHash

data HashedDir #

Semantically, this is the type of hashed objects. Git has a type tag inside the hashed file itself, whereas in Darcs the type is determined by the subdirectory.

Instances

Instances details
Eq HashedDir # 
Instance details

Defined in Darcs.Util.ValidHash

getHash :: ValidHash h => h -> Hash #

getSize :: ValidHash h => h -> Maybe Int #

fromHash :: ValidHash h => Hash -> h #

checkHash :: ValidHash h => h -> ByteString -> Bool #

Verify file content against a given ValidHash.

okayHash :: String -> Bool #

Check that the given String is an encoding of some ValidHash.