cabal-install-3.10.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.HashValue

Synopsis

Documentation

data HashValue Source #

Instances

Instances details
Structured HashValue Source # 
Instance details

Defined in Distribution.Client.HashValue

Generic HashValue Source # 
Instance details

Defined in Distribution.Client.HashValue

Associated Types

type Rep HashValue :: Type -> Type #

Show HashValue Source # 
Instance details

Defined in Distribution.Client.HashValue

Binary HashValue Source # 
Instance details

Defined in Distribution.Client.HashValue

Eq HashValue Source # 
Instance details

Defined in Distribution.Client.HashValue

type Rep HashValue Source # 
Instance details

Defined in Distribution.Client.HashValue

type Rep HashValue = D1 ('MetaData "HashValue" "Distribution.Client.HashValue" "cabal-install-3.10.1.0-FbhGUvZ0l0XIx7QbOQfSVh" 'True) (C1 ('MetaCons "HashValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

hashValue :: ByteString -> HashValue Source #

Hash some data. Currently uses SHA256.

truncateHash :: Int -> HashValue -> HashValue Source #

Truncate a 32 byte SHA256 hash to

For example 20 bytes render as 40 hex chars, which we use for unit-ids. Or even 4 bytes for hashedInstalledPackageIdShort

readFileHashValue :: FilePath -> IO HashValue Source #

Hash the content of a file. Uses SHA256.

hashFromTUF :: Hash -> HashValue Source #

Convert a hash from TUF metadata into a PackageSourceHash.

Note that TUF hashes don't necessarily have to be SHA256, since it can support new algorithms in future.