Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Hash
- = SHA256 !ByteString
- | NoHash
- encodeBase16 :: Hash -> ByteString
- decodeBase16 :: ByteString -> Hash
- sha256 :: ByteString -> Hash
- sha256sum :: ByteString -> String
- rawHash :: Hash -> ByteString
- match :: Hash -> Hash -> Bool
- sha1PS :: ByteString -> SHA1
- data SHA1
- showAsHex :: Word32 -> String
- sha1Xor :: SHA1 -> SHA1 -> SHA1
- sha1zero :: SHA1
- sha1short :: SHA1 -> Word32
Documentation
Instances
Eq Hash Source # | |
Data Hash Source # | |
Defined in Darcs.Util.Hash 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 # 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 # | |
Read Hash Source # | |
Show Hash Source # | |
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.
rawHash :: Hash -> ByteString Source #
sha1PS :: ByteString -> SHA1 Source #