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

Method test_sha256_update_over_4gb

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

Source from the content-addressed store, hash-verified

495
496 @requires_resource('cpu')
497 def test_sha256_update_over_4gb(self):
498 zero_1mb = b"\0" * 1024 * 1024
499 h = hashlib.sha256()
500 for i in range(0, 4096):
501 h.update(zero_1mb)
502 h.update(b"hello world")
503 self.assertEqual(h.hexdigest(), "a5364f7a52ebe2e25f1838a4ca715a893b6fd7a23f2a0d9e9762120da8b1bf53")
504
505 @requires_resource('cpu')
506 def test_sha3_256_update_over_4gb(self):

Callers

nothing calls this directly

Calls 3

hexdigestMethod · 0.80
updateMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected