hydra-cardano-api-0.19.0: A Haskell API for Cardano, tailored to the Hydra project.
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Cardano.Api.Hash

Synopsis

Type conversions

toPlutusKeyHash :: Hash PaymentKey -> PubKeyHash Source #

Convert a cardano-api Hash into a plutus PubKeyHash

toLedgerKeyHash :: Hash PaymentKey -> KeyHash 'Witness StandardCrypto Source #

Convert a cardano-api Hash into a cardano-ledger KeyHash

unsafePaymentKeyHashFromBytes :: HasCallStack => ByteString -> Hash PaymentKey Source #

Unsafe wrap some bytes as a 'Hash PaymentKey'.

Pre-condition: the input bytestring MUST be of length 28.

unsafeScriptHashFromBytes :: HasCallStack => ByteString -> ScriptHash Source #

Unsafe wrap some bytes as a ScriptHash, relying on the fact that Plutus is using Blake2b_224 for hashing data (according to 'cardano-ledger').

Pre-condition: the input bytestring MUST be of length 28.

unsafeScriptDataHashFromBytes :: HasCallStack => ByteString -> Hash ScriptData Source #

Unsafe wrap some bytes as a 'Hash ScriptData', relying on the fact that Plutus is using Blake2b_256 for hashing data (according to 'cardano-ledger').

Pre-condition: the input bytestring MUST be of length 32.