Safe Haskell | None |
---|---|
Language | Haskell98 |
A module providing checksum computations to other parts of Hans. The checksum here is the standard Internet 16-bit checksum (the one's complement of the one's complement sum of the data).
- computeChecksum :: Word32 -> ByteString -> Word16
- finalizeChecksum :: PartialChecksum -> Word16
- computePartialChecksum :: PartialChecksum -> ByteString -> PartialChecksum
- computePartialChecksumLazy :: PartialChecksum -> ByteString -> PartialChecksum
- clearChecksum :: ByteString -> Int -> IO ByteString
- pokeChecksum :: Word16 -> ByteString -> Int -> IO ByteString
- emptyPartialChecksum :: PartialChecksum
Documentation
computeChecksum :: Word32 -> ByteString -> Word16 Source
Compute the final checksum, using the given initial value.
finalizeChecksum :: PartialChecksum -> Word16 Source
computePartialChecksum :: PartialChecksum -> ByteString -> PartialChecksum Source
Compute a partial checksum, yielding a value suitable to be passed to computeChecksum.
computePartialChecksumLazy :: PartialChecksum -> ByteString -> PartialChecksum Source
Compute the checksum of a lazy bytestring.
clearChecksum :: ByteString -> Int -> IO ByteString Source
Clear the two bytes at the checksum offset of a rendered packet.
pokeChecksum :: Word16 -> ByteString -> Int -> IO ByteString Source
Poke a checksum into a bytestring.
emptyPartialChecksum :: PartialChecksum Source