Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Internal.Serialise.Cbor.Canonical
Contents
Synopsis
Documentation
canonicaliseCborBs :: ByteString -> Either DecoderError ByteString Source #
This function implements CBOR canonicalisation (RFC 7049):
- Map keys are sorted lexicographically
- Indefinite-length mapslists are converted to finite-length mapslists
- The representation of the CBOR major types is as small as possible (provided by "cborg" package)
This function implements only CBOR canonicalisation from CIP-21. Other requirements from CIP-21 are not implemented.
- CBOR RFC 7049, Canonicalisation description: https://datatracker.ietf.org/doc/html/rfc7049#section-3.9
- CIP-21: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0021/README.md#canonical-cbor-serialization-format
canonicaliseTerm :: Term -> Term Source #
This function implements CBOR canonicalisation at the Term level:
- Map keys are sorted lexicographically
- Indefinite-length mapslists are converted to finite-length mapslists
Orphan instances
HasTypeProxy Term Source # | |
SerialiseAsCBOR Term Source # | |
Methods serialiseToCBOR :: Term -> ByteString Source # deserialiseFromCBOR :: AsType Term -> ByteString -> Either DecoderError Term Source # |