ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.FS.CRC

Description

Support for CRC

Synopsis

Wrap digest functionality

newtype CRC Source #

Constructors

CRC 

Fields

Instances

Instances details
Eq CRC Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.FS.CRC

Methods

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

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

Show CRC Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.FS.CRC

Methods

showsPrec :: Int -> CRC -> ShowS #

show :: CRC -> String #

showList :: [CRC] -> ShowS #

Generic CRC Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.FS.CRC

Associated Types

type Rep CRC :: Type -> Type #

Methods

from :: CRC -> Rep CRC x #

to :: Rep CRC x -> CRC #

Storable CRC Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.FS.CRC

Methods

sizeOf :: CRC -> Int #

alignment :: CRC -> Int #

peekElemOff :: Ptr CRC -> Int -> IO CRC #

pokeElemOff :: Ptr CRC -> Int -> CRC -> IO () #

peekByteOff :: Ptr b -> Int -> IO CRC #

pokeByteOff :: Ptr b -> Int -> CRC -> IO () #

peek :: Ptr CRC -> IO CRC #

poke :: Ptr CRC -> CRC -> IO () #

NoThunks CRC Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.FS.CRC

type Rep CRC Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.FS.CRC

type Rep CRC = D1 ('MetaData "CRC" "Ouroboros.Consensus.Storage.FS.CRC" "ouroboros-consensus-0.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'True) (C1 ('MetaCons "CRC" 'PrefixI 'True) (S1 ('MetaSel ('Just "getCRC") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

updateCRC :: forall a. CRC32 a => a -> CRC -> CRC Source #

computeCRC :: forall a. CRC32 a => a -> CRC Source #

File system functions with CRC functionality

hPutAllCRC :: forall m h. (HasCallStack, Monad m) => HasFS m h -> Handle h -> ByteString -> m (Word64, CRC) Source #

Variation on hPutAll that also computes a CRC

hGetExactlyAtCRC Source #

Arguments

:: forall m h. (HasCallStack, MonadThrow m) 
=> HasFS m h 
-> Handle h 
-> Word64

The number of bytes to read.

-> AbsOffset

The offset at which to read.

-> m (ByteString, CRC) 

Variation on hGetExactlyAt that also computes a CRC

hGetAllAtCRC Source #

Arguments

:: forall m h. Monad m 
=> HasFS m h 
-> Handle h 
-> AbsOffset

The offset at which to read.

-> m (ByteString, CRC) 

Variation on hGetAllAt that also computes a CRC