Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- mkStorePathHash :: forall a. HashAlgorithm a => ByteString -> ByteString
- class HashAlgorithm a => NamedAlgo a where
- data SomeNamedDigest = forall a.NamedAlgo a => SomeDigest (Digest a)
- mkNamedDigest :: Text -> Text -> Either String SomeNamedDigest
- data BaseEncoding
- encodeDigestWith :: BaseEncoding -> Digest a -> Text
- decodeDigestWith :: HashAlgorithm a => BaseEncoding -> Text -> Either String (Digest a)
Documentation
mkStorePathHash :: forall a. HashAlgorithm a => ByteString -> ByteString Source #
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 #
data BaseEncoding Source #
Constructors to indicate the base encodings
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