hnix-store-core-0.6.0.0: Core effects for interacting with the Nix store.
Safe HaskellNone
LanguageHaskell2010

System.Nix.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

data BaseEncoding Source #

Constructors to indicate the base encodings

Constructors

NixBase32 
Base16

^ Nix has a special map of Base32 encoding Placed first, since it determines Haskell optimizations of pattern matches, & NixBase seems be the most widely used in Nix.

Base64 

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