Skip to content

Comments

control first and last bytes size, optionally disable it#208

Merged
pauldreik merged 12 commits intodevelfrom
control_first_and_last_bytes_size
Feb 15, 2026
Merged

control first and last bytes size, optionally disable it#208
pauldreik merged 12 commits intodevelfrom
control_first_and_last_bytes_size

Conversation

@pauldreik
Copy link
Owner

@pauldreik pauldreik commented Feb 15, 2026

this adds control over the stages "read first bytes" and "read last bytes".

the idea is to make it possible to skip one or both, and control the size of the read.

the current first/last bytes pass read the bytes into the checksum field. this is now replaced with calculating a checksum over the first/last bytes.

if the file is so small that it is smaller than the first/last byte size, the checksum is not calculated again (unless the checksum algorithm is different).

the checksumming used for the first/last bytes is selected as a fast one, since if there would be a hash collision it will be caught by the full checksumming step later.

@pauldreik pauldreik force-pushed the control_first_and_last_bytes_size branch from e8fde9a to 6054d03 Compare February 15, 2026 09:16
@pauldreik pauldreik force-pushed the control_first_and_last_bytes_size branch from 6054d03 to 6167294 Compare February 15, 2026 18:53
@pauldreik pauldreik force-pushed the control_first_and_last_bytes_size branch from 15bbc12 to 4d47d33 Compare February 15, 2026 20:40
@pauldreik pauldreik marked this pull request as ready for review February 15, 2026 20:41
@pauldreik pauldreik changed the title control first and last bytes size control first and last bytes size, optionally disable it Feb 15, 2026
@pauldreik pauldreik merged commit 868b858 into devel Feb 15, 2026
33 checks passed
@pauldreik pauldreik deleted the control_first_and_last_bytes_size branch February 15, 2026 20:42
pauldreik added a commit that referenced this pull request Feb 15, 2026
this adds control over the stages "read first bytes" and "read last
bytes".

the idea is to make it possible to skip one or both, and control the
size of the read.

the current first/last bytes pass read the bytes into the checksum
field. this is now replaced with calculating a checksum over the
first/last bytes.

if the file is so small that it is smaller than the first/last byte
size, the checksum is not calculated again (unless the checksum
algorithm is different).

the checksumming used for the first/last bytes is selected as a fast
one, since if there would be a hash collision it will be caught by the
full checksumming step later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant