circe-1.1.0.0: CRC
Safe HaskellNone
LanguageHaskell2010

Codec.Circe.Internal

Description

Internal CRC functions. See Codec.Circe for the stable API.

Synopsis

CRC

data CRCCfg a Source #

CRC configuration parameters

Constructors

CRCCfg 

Fields

Instances

Instances details
Functor CRCCfg Source # 
Instance details

Defined in Codec.Circe.Internal

Methods

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

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

Read a => Read (CRCCfg a) Source # 
Instance details

Defined in Codec.Circe.Internal

Show a => Show (CRCCfg a) Source # 
Instance details

Defined in Codec.Circe.Internal

Methods

showsPrec :: Int -> CRCCfg a -> ShowS #

show :: CRCCfg a -> String #

showList :: [CRCCfg a] -> ShowS #

Eq a => Eq (CRCCfg a) Source # 
Instance details

Defined in Codec.Circe.Internal

Methods

(==) :: CRCCfg a -> CRCCfg a -> Bool #

(/=) :: CRCCfg a -> CRCCfg a -> Bool #

crcInternal :: (FiniteBits a, Integral a, Num a, Storable a) => (a -> a) -> CRCCfg a -> ByteString -> a Source #

calculate CRC using lookup table generated from config

crcWithTable :: (FiniteBits a, Integral a, Num a, Storable a) => (a -> a) -> Vector a -> CRCCfg a -> ByteString -> a Source #

calculate CRC with reflection & precalculated poly table.

crcUnsafe :: (FiniteBits a, Integral a, Num a, Storable a) => Vector a -> Bool -> a -> ByteString -> a Source #

calculate CRC using width, efficient lookup table, input reflection, and init value

crcStep :: (FiniteBits a, Integral a, Num a, Storable a) => Vector a -> a -> Word8 -> a Source #

single crc iteration with table and accumulator

crcIdx :: (FiniteBits a, Integral a, Num a) => a -> Word8 -> Int Source #

calculate lookup table index

crcTable :: (FiniteBits a, Num a, Storable a) => a -> Vector a Source #

Generate CRC table using width and poly

Prettyprinting

w8 :: Word8 -> String Source #

0x0a

w16 :: Word16 -> String Source #

0x01ab

w32 :: Word32 -> String Source #

0x0123abcd

w64 :: Word64 -> String Source #

0x01234567abcdefff

table :: [String] -> String Source #

prettyprint 8 cols across

Reflection

ref8 :: Word8 -> Word8 Source #

Reflect Word8