crypto-multihash-0.1.0.0: Multihash library on top of cryptonite crypto library

Safe HaskellNone
LanguageHaskell2010

Crypto.Multihash

Synopsis

Documentation

data MultihashDigest a Source #

Multihash Digest container

data Base Source #

Constructors

Base16

Hex encoding

Base32

Not implemented. For reasons that I did not investigate, the instance in Data.ByteArray produces output not conformant with the multihash spec.

Base58

Bitcoin Base58 encoding, the one used also by IPFS

Base64

Base64 encoding

Instances

Eq Base Source # 

Methods

(==) :: Base -> Base -> Bool #

(/=) :: Base -> Base -> Bool #

class HashAlgorithm a where #

Class representing hashing algorithms.

The interface presented here is update in place and lowlevel. the Hash module takes care of hidding the mutable interface properly.

Instances

HashAlgorithm SHA3_224 
HashAlgorithm SHA3_256 
HashAlgorithm SHA3_384 
HashAlgorithm SHA3_512 
HashAlgorithm SHA512 
HashAlgorithm SHA256 
HashAlgorithm SHA1 
HashAlgorithm Blake2b_512 
HashAlgorithm Blake2s_224 
HashAlgorithm Blake2s_256 

data SHA1 :: * #

SHA1 cryptographic hash algorithm

Constructors

SHA1 

encode :: (HashAlgorithm a, Codable a, Show a) => Base -> MultihashDigest a -> String Source #

Encoder for Multihashes. Throws an error if the Multihash length field does not match the Digest length