License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unix |
Safe Haskell | None |
Language | Haskell98 |
- data Ref hash
- data SHA1 :: *
- class HashAlgorithm a where
- hashDigestSize :: HashAlgorithm a => a -> Int
- data RefInvalid = RefInvalid ByteString
- data RefNotFound hash = RefNotFound (Ref hash)
- isHex :: ByteString -> Bool
- isHexString :: String -> Bool
- fromHex :: HashAlgorithm hash => ByteString -> Ref hash
- fromHexString :: HashAlgorithm hash => String -> Ref hash
- fromBinary :: HashAlgorithm hash => ByteString -> Ref hash
- fromDigest :: HashAlgorithm hash => Digest hash -> Ref hash
- toBinary :: Ref hash -> ByteString
- toHex :: Ref hash -> ByteString
- toHexString :: Ref hash -> String
- refPrefix :: Ref hash -> Int
- cmpPrefix :: String -> Ref hash -> Ordering
- toFilePathParts :: Ref hash -> (String, String)
- hash :: HashAlgorithm hash => ByteString -> Ref hash
- hashLBS :: HashAlgorithm hash => ByteString -> Ref hash
- hashAlg :: HashAlgorithm hash => hash
- hashAlgFromRef :: HashAlgorithm hash => Ref hash -> hash
Documentation
represent a git reference (SHA1)
SHA1 cryptographic hash algorithm
Data SHA1 | |
Show SHA1 | |
HashAlgorithm SHA1 | |
Resolvable (Ref SHA1) Source # | |
type HashInternalContextSize SHA1 | |
type HashDigestSize SHA1 | |
type HashBlockSize SHA1 | |
class HashAlgorithm a where #
Class representing hashing algorithms.
The interface presented here is update in place and lowlevel. the Hash module takes care of hidding the mutable interface properly.
hashBlockSize, hashDigestSize, hashInternalContextSize, hashInternalInit, hashInternalUpdate, hashInternalFinalize
hashDigestSize :: a -> Int #
Get the digest size of a hash algorithm
hashDigestSize :: HashAlgorithm a => a -> Int #
Get the digest size of a hash algorithm
Exceptions
data RefInvalid Source #
Invalid Reference exception raised when using something that is not a ref as a ref.
data RefNotFound hash Source #
Reference wasn't found
RefNotFound (Ref hash) |
Eq (RefNotFound hash) Source # | |
Show (RefNotFound hash) Source # | |
Typeable * hash => Exception (RefNotFound hash) Source # | |
convert from bytestring and string
isHex :: ByteString -> Bool Source #
isHexString :: String -> Bool Source #
fromHex :: HashAlgorithm hash => ByteString -> Ref hash Source #
take a hexadecimal bytestring that represent a reference and turn into a ref
fromHexString :: HashAlgorithm hash => String -> Ref hash Source #
take a hexadecimal string that represent a reference and turn into a ref
fromBinary :: HashAlgorithm hash => ByteString -> Ref hash Source #
transform a bytestring that represent a binary bytestring and returns a ref.
fromDigest :: HashAlgorithm hash => Digest hash -> Ref hash Source #
transform a bytestring that represent a binary bytestring and returns a ref.
toBinary :: Ref hash -> ByteString Source #
turn a reference into a binary bytestring
toHex :: Ref hash -> ByteString Source #
transform a ref into an hexadecimal bytestring
toHexString :: Ref hash -> String Source #
transform a ref into an hexadecimal string
Misc function related to ref
toFilePathParts :: Ref hash -> (String, String) Source #
returns the splitted format "prefix/suffix" for addressing the loose object database
Hash ByteString types to a ref
hash :: HashAlgorithm hash => ByteString -> Ref hash Source #
hash a bytestring into a reference
hashLBS :: HashAlgorithm hash => ByteString -> Ref hash Source #
hash a lazy bytestring into a reference
hashAlg :: HashAlgorithm hash => hash Source #
Any hash algorithm
hashAlgFromRef :: HashAlgorithm hash => Ref hash -> hash Source #