Пример #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