MCPcopy Index your code
hub / github.com/python/cpython / test_blake2_update_over_4gb

Method test_blake2_update_over_4gb

Lib/test/test_hashlib.py:516–524  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

514 @requires_resource('cpu')
515 @requires_blake2
516 def test_blake2_update_over_4gb(self):
517 # blake2s or blake2b doesn't matter based on how our C code is structured, this tests the
518 # common loop macro logic.
519 zero_1mb = b"\0" * 1024 * 1024
520 h = hashlib.blake2s()
521 for i in range(0, 4096):
522 h.update(zero_1mb)
523 h.update(b"hello world")
524 self.assertEqual(h.hexdigest(), "8a268e83dd30528bc0907fa2008c91de8f090a0b6e0e60a5ff0d999d8485526f")
525
526 def check(self, name, data, hexdigest, shake=False, **kwargs):
527 length = len(hexdigest)//2

Callers

nothing calls this directly

Calls 3

hexdigestMethod · 0.80
updateMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected