cardano-crypto-class-2.2.0.0: Type classes abstracting over cryptography primitives for Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Crypto.Util

Synopsis

Documentation

class Empty a Source #

Instances

Instances details
Empty a Source # 
Instance details

Defined in Cardano.Crypto.Util

class SignableRepresentation a where Source #

A class of types that have a representation in bytes that can be used for signing and verifying.

Instances

Instances details
SignableRepresentation ByteString Source # 
Instance details

Defined in Cardano.Crypto.Util

Simple serialisation used in mock instances

Low level conversions

bytesToNaturalByteStringNatural Source #

Create a Natural out of a ByteString, in big endian.

This is fast enough to use in production.

naturalToBytesIntNaturalByteString Source #

The inverse of bytesToNatural. Note that this is a naive implementation and only suitable for tests.

ByteString manipulation

Base16 conversion

decodeHexByteStringByteStringIntEither String ByteString Source #

Decode base16 ByteString, while ensuring expected length.

decodeHexStringStringIntEither String ByteString Source #

Decode base16 String, while ensuring expected length. Unlike decodeHexByteString this function expects a '0x' prefix.

decodeHexStringQStringIntQ Exp Source #

Decode a String with Hex characters, while ensuring expected length.