darcs-2.14.3: a distributed, interactive, smart revision control system

Safe HaskellNone
LanguageHaskell2010

Darcs.Util.Hash

Synopsis

Documentation

data Hash Source #

Constructors

SHA256 !ByteString 
NoHash 
Instances
Eq Hash Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

(==) :: Hash -> Hash -> Bool #

(/=) :: Hash -> Hash -> Bool #

Data Hash Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Hash -> c Hash #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Hash #

toConstr :: Hash -> Constr #

dataTypeOf :: Hash -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Hash) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Hash) #

gmapT :: (forall b. Data b => b -> b) -> Hash -> Hash #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Hash -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Hash -> r #

gmapQ :: (forall d. Data d => d -> u) -> Hash -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Hash -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Hash -> m Hash #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Hash -> m Hash #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Hash -> m Hash #

Ord Hash Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

compare :: Hash -> Hash -> Ordering #

(<) :: Hash -> Hash -> Bool #

(<=) :: Hash -> Hash -> Bool #

(>) :: Hash -> Hash -> Bool #

(>=) :: Hash -> Hash -> Bool #

max :: Hash -> Hash -> Hash #

min :: Hash -> Hash -> Hash #

Read Hash Source # 
Instance details

Defined in Darcs.Util.Hash

Show Hash Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

showsPrec :: Int -> Hash -> ShowS #

show :: Hash -> String #

showList :: [Hash] -> ShowS #

encodeBase16 :: Hash -> ByteString Source #

Produce a base16 (ascii-hex) encoded string from a hash. This can be turned back into a Hash (see "decodeBase16". This is a loss-less process.

decodeBase16 :: ByteString -> Hash Source #

Take a base16-encoded string and decode it as a Hash. If the string is malformed, yields NoHash.

sha256 :: ByteString -> Hash Source #

Compute a sha256 of a (lazy) ByteString.

sha256sum :: ByteString -> String Source #

Same as previous but general purpose.

data SHA1 Source #

Instances
Eq SHA1 Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

(==) :: SHA1 -> SHA1 -> Bool #

(/=) :: SHA1 -> SHA1 -> Bool #

Ord SHA1 Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

compare :: SHA1 -> SHA1 -> Ordering #

(<) :: SHA1 -> SHA1 -> Bool #

(<=) :: SHA1 -> SHA1 -> Bool #

(>) :: SHA1 -> SHA1 -> Bool #

(>=) :: SHA1 -> SHA1 -> Bool #

max :: SHA1 -> SHA1 -> SHA1 #

min :: SHA1 -> SHA1 -> SHA1 #

Show SHA1 Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

showsPrec :: Int -> SHA1 -> ShowS #

show :: SHA1 -> String #

showList :: [SHA1] -> ShowS #

Binary SHA1 Source # 
Instance details

Defined in Darcs.Util.Hash

Methods

put :: SHA1 -> Put #

get :: Get SHA1 #

putList :: [SHA1] -> Put #