Skip to content

Commit d0e7691

Browse files
committed
Review changes
- yield from - use sha1 instead of md5 in test (algorithm guarantee of hashlib)
1 parent 9d04511 commit d0e7691

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Lib/base64.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ def _85buffer_iter_words(b):
312312

313313
offset = 0
314314
for _ in range(n1):
315-
for c in unpack512(b[offset:offset+512]):
316-
yield c
315+
yield from unpack512(b[offset:offset+512])
317316
offset += 512
318317

319318
for _ in range(n2):

Lib/test/test_base64.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,10 @@ def test_b85encode_large_input(self):
553553
result = base64.b85encode(large_input)
554554

555555
# since the result is to large to fit inside a test,
556-
# use a hash method to validate the test
556+
# use a hash method to validate the value
557557
self.assertEqual(len(result), 784)
558-
self.assertEqual(hashlib.md5(result).hexdigest(),
559-
"0537cfca1aed7495e80d3328e9ef3008")
558+
self.assertEqual(hashlib.sha1(result).hexdigest(),
559+
"01a925210f86cf17dece89052406fbd68edb750e")
560560

561561
def test_z85encode(self):
562562
eq = self.assertEqual

0 commit comments

Comments
 (0)