Safe Haskell | None |
---|---|
Language | Haskell2010 |
Distribution.Client.HashValue
Synopsis
- data HashValue
- hashValue :: ByteString -> HashValue
- truncateHash :: Int -> HashValue -> HashValue
- showHashValue :: HashValue -> String
- showHashValueBase64 :: HashValue -> String
- readFileHashValue :: FilePath -> IO HashValue
- hashFromTUF :: Hash -> HashValue
Documentation
Instances
Structured HashValue Source # | |||||
Defined in Distribution.Client.HashValue | |||||
Generic HashValue Source # | |||||
Defined in Distribution.Client.HashValue Associated Types
| |||||
Show HashValue Source # | |||||
Binary HashValue Source # | |||||
Eq HashValue Source # | |||||
type Rep HashValue Source # | |||||
Defined in Distribution.Client.HashValue |
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
showHashValue :: HashValue -> String Source #
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.