multihash-serialise-0.1.0.0: CBOR encoding of multihashes

Copyright2018 Monadic GmbH
LicenseBSD3
Maintainerkim@monadic.xyz, team@monadic.xyz
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Codec.Serialise.Multihash

Contents

Description

A mapping of multihash to CBOR.

Instead of an opaque, multihash-encoded blob, this provides a tagged CBOR encoding where the hash algorithm used is a Word16 field containing the multihash code for the algorithm, followed by the digest bytes.

Synopsis

Documentation

encode :: Multihashable a => Digest a -> Encoding Source #

Multihash-like CBOR Encoding of a Digest.

decode :: forall s a. Multihashable a => Decoder s (Digest a) Source #

CBOR Decoder to decode a Digest encoded via encodeCBOR.

Re-exports

type Multihashable a = (HashAlgorithm a, FromCryptonite a) #