1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-26 21:09:44 +01:00

Use the CRC32C implementation in snappy-framing.

This commit is contained in:
fkm3 2017-02-09 07:09:55 -08:00
parent 02591ca364
commit ce6717a9f8

View file

@ -23,13 +23,14 @@ module TensorFlow.CRC32C
import Data.Bits (rotateL, rotateR) import Data.Bits (rotateL, rotateR)
import qualified Data.ByteString as B import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy as BL
import Data.Digest.CRC32C (crc32c_update)
import Data.List (foldl') import Data.List (foldl')
import Data.Word (Word32) import Data.Word (Word32)
-- | Compute the CRC32C checksum of the concatenation of the bytes checksummed -- | Compute the CRC32C checksum of the concatenation of the bytes checksummed
-- by the given CRC32C value and the bytes in the given ByteString. -- by the given CRC32C value and the bytes in the given ByteString.
extend :: Word32 -> B.ByteString -> Word32 extend :: Word32 -> B.ByteString -> Word32
extend = _crcExtend extend = crc32c_update
-- | Compute the CRC32C checksum of the given bytes. -- | Compute the CRC32C checksum of the given bytes.
value :: BL.ByteString -> Word32 value :: BL.ByteString -> Word32