We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10c6b51 commit a56be0fCopy full SHA for a56be0f
cyclonedx/model/__init__.py
@@ -39,11 +39,9 @@ def sha1sum(filename: str) -> str:
39
SHA-1 hash
40
"""
41
h = hashlib.sha1()
42
- b = bytearray(128 * 1024)
43
- mv = memoryview(b)
44
- with open(filename, 'rb', buffering=0) as f:
45
- for n in iter(lambda: f.readinto(mv), 0):
46
- h.update(mv[:n])
+ with open(filename, 'rb') as f:
+ for byte_block in iter(lambda: f.read(4096), b""):
+ h.update(byte_block)
47
return h.hexdigest()
48
49
0 commit comments