diff --git a/tar.py b/tar.py index 48c8dcf..81b7226 100644 --- a/tar.py +++ b/tar.py @@ -61,7 +61,7 @@ def header_chunk(filename: str, filepath: str) -> bytes: # POSIX 1003.1-1990: 255 empty bytes - # Compute the checksum: we start at 248 which are the 8 fields of checksum filled with spaces (32 * 8) + # Compute the checksum: we start at 256 which are the 8 fields of checksum filled with spaces (32 * 8) checksum = oct(functools.reduce(lambda x, y: x + y, buffer, 256)).rjust(6, '0').encode('ascii') buffer[148:154] = checksum