def test_update(): chunk = b"DEADBEEF" helper = crc32c.Checksum() helper.update(chunk) assert helper._crc == crc32c.value(chunk)
def test_value(chunk, expected): assert crc32c.value(chunk) == expected
def test_ctor_explicit(): chunk = b"DEADBEEF" helper = crc32c.Checksum(chunk) assert helper._crc == crc32c.value(chunk)
def crc32c(binary): """ Computes the crc32c of a binary string and returns it as an integer. """ return crc32clib.value(binary) # an integer