scuttlebutt-types-0.4.0: generic types for Secure Scuttlebutt

Safe HaskellNone
LanguageHaskell2010

Ssb.Types.Hash

Synopsis

Documentation

newtype Hash Source #

Constructors

Sha256 

Fields

Instances

Eq Hash Source # 

Methods

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

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

Ord Hash Source # 

Methods

compare :: Hash -> Hash -> Ordering #

(<) :: Hash -> Hash -> Bool #

(<=) :: Hash -> Hash -> Bool #

(>) :: Hash -> Hash -> Bool #

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

max :: Hash -> Hash -> Hash #

min :: Hash -> Hash -> Hash #

Show Hash Source # 

Methods

showsPrec :: Int -> Hash -> ShowS #

show :: Hash -> String #

showList :: [Hash] -> ShowS #

parseSha256 :: ByteString -> Maybe Hash Source #

Decodes a SHA256 hash, which is base64 encoded.

formatHash :: Hash -> ByteString Source #

Formats a hash as a base64 encoded string.

data Hashed v Source #

A value accompanied with the hash of the ByteString that it was deserialized from.

Constructors

Hashed 

Fields

Instances

Functor Hashed Source # 

Methods

fmap :: (a -> b) -> Hashed a -> Hashed b #

(<$) :: a -> Hashed b -> Hashed a #

Eq v => Eq (Hashed v) Source # 

Methods

(==) :: Hashed v -> Hashed v -> Bool #

(/=) :: Hashed v -> Hashed v -> Bool #

Ord v => Ord (Hashed v) Source # 

Methods

compare :: Hashed v -> Hashed v -> Ordering #

(<) :: Hashed v -> Hashed v -> Bool #

(<=) :: Hashed v -> Hashed v -> Bool #

(>) :: Hashed v -> Hashed v -> Bool #

(>=) :: Hashed v -> Hashed v -> Bool #

max :: Hashed v -> Hashed v -> Hashed v #

min :: Hashed v -> Hashed v -> Hashed v #

Show v => Show (Hashed v) Source # 

Methods

showsPrec :: Int -> Hashed v -> ShowS #

show :: Hashed v -> String #

showList :: [Hashed v] -> ShowS #