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