hnix-store-core-0.7.0.0: Core effects for interacting with the Nix store.
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Nix.Internal.Hash

Description

 
Synopsis

Documentation

class HashAlgorithm a => NamedAlgo a where Source #

A HashAlgorithm with a canonical name, for serialization purposes (e.g. SRI hashes)

Methods

algoName :: Text Source #

Instances

Instances details
NamedAlgo MD5 Source # 
Instance details

Defined in System.Nix.Internal.Hash

Methods

algoName :: Text Source #

NamedAlgo SHA1 Source # 
Instance details

Defined in System.Nix.Internal.Hash

Methods

algoName :: Text Source #

NamedAlgo SHA256 Source # 
Instance details

Defined in System.Nix.Internal.Hash

Methods

algoName :: Text Source #

NamedAlgo SHA512 Source # 
Instance details

Defined in System.Nix.Internal.Hash

Methods

algoName :: Text Source #

data SomeNamedDigest Source #

A digest whose NamedAlgo is not known at compile time.

Constructors

forall a.NamedAlgo a => SomeDigest (Digest a) 

Instances

Instances details
Show SomeNamedDigest Source # 
Instance details

Defined in System.Nix.Internal.Hash

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