| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | unix |
| Safe Haskell | None |
| Language | Haskell98 |
Data.Git.Ref
Contents
Description
- 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
Instances
| Data SHA1 | |
| Show SHA1 | |
| HashAlgorithm SHA1 | |
| Resolvable (Ref SHA1) # | |
| 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.
Minimal complete definition
hashBlockSize, hashDigestSize, hashInternalContextSize, hashInternalInit, hashInternalUpdate, hashInternalFinalize
Instances
hashDigestSize :: HashAlgorithm a => a -> Int #
Get the digest size of a hash algorithm
Exceptions
data RefInvalid #
Invalid Reference exception raised when using something that is not a ref as a ref.
Constructors
| RefInvalid ByteString |
Instances
data RefNotFound hash #
Reference wasn't found
Constructors
| RefNotFound (Ref hash) |
Instances
| Eq (RefNotFound hash) # | |
| Show (RefNotFound hash) # | |
| Typeable * hash => Exception (RefNotFound hash) # | |
convert from bytestring and string
isHex :: ByteString -> Bool #
isHexString :: String -> Bool #
fromHex :: HashAlgorithm hash => ByteString -> Ref hash #
take a hexadecimal bytestring that represent a reference and turn into a ref
fromHexString :: HashAlgorithm hash => String -> Ref hash #
take a hexadecimal string that represent a reference and turn into a ref
fromBinary :: HashAlgorithm hash => ByteString -> Ref hash #
transform a bytestring that represent a binary bytestring and returns a ref.
fromDigest :: HashAlgorithm hash => Digest hash -> Ref hash #
transform a bytestring that represent a binary bytestring and returns a ref.
toBinary :: Ref hash -> ByteString #
turn a reference into a binary bytestring
toHex :: Ref hash -> ByteString #
transform a ref into an hexadecimal bytestring
toHexString :: Ref hash -> String #
transform a ref into an hexadecimal string
Misc function related to ref
toFilePathParts :: Ref hash -> (String, String) #
returns the splitted format "prefix/suffix" for addressing the loose object database
Hash ByteString types to a ref
hash :: HashAlgorithm hash => ByteString -> Ref hash #
hash a bytestring into a reference
hashLBS :: HashAlgorithm hash => ByteString -> Ref hash #
hash a lazy bytestring into a reference
hashAlg :: HashAlgorithm hash => hash #
Any hash algorithm
hashAlgFromRef :: HashAlgorithm hash => Ref hash -> hash #