Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class HashAlgorithm a => NamedAlgo a where
- data SomeNamedDigest = forall a.NamedAlgo a => SomeDigest (Digest a)
- mkNamedDigest :: Text -> Text -> Either String SomeNamedDigest
- encodeDigestWith :: BaseEncoding -> Digest a -> Text
- decodeDigestWith :: HashAlgorithm a => BaseEncoding -> Text -> Either String (Digest a)
- mkStorePathHash :: forall a. HashAlgorithm a => ByteString -> ByteString
Documentation
class HashAlgorithm a => NamedAlgo a where Source #
A HashAlgorithm
with a canonical name, for serialization
purposes (e.g. SRI hashes)
Instances
NamedAlgo MD5 Source # | |
Defined in System.Nix.Internal.Hash | |
NamedAlgo SHA1 Source # | |
Defined in System.Nix.Internal.Hash | |
NamedAlgo SHA256 Source # | |
Defined in System.Nix.Internal.Hash | |
NamedAlgo SHA512 Source # | |
Defined in System.Nix.Internal.Hash |
data SomeNamedDigest Source #
A digest whose NamedAlgo
is not known at compile time.
forall a.NamedAlgo a => SomeDigest (Digest a) |
Instances
Show SomeNamedDigest Source # | |
Defined in System.Nix.Internal.Hash showsPrec :: Int -> SomeNamedDigest -> ShowS # show :: SomeNamedDigest -> String # showList :: [SomeNamedDigest] -> ShowS # |
mkNamedDigest :: Text -> Text -> Either String SomeNamedDigest Source #
encodeDigestWith :: BaseEncoding -> Digest a -> Text Source #
Take BaseEncoding type of the output -> take the Digeest as input -> encode Digest
decodeDigestWith :: HashAlgorithm a => BaseEncoding -> Text -> Either String (Digest a) Source #
Take BaseEncoding type of the input -> take the input itself -> decodeBase into Digest
mkStorePathHash :: forall a. HashAlgorithm a => ByteString -> ByteString Source #