Skip to main content

compute_seek_params

Function compute_seek_params 

Source
pub fn compute_seek_params(
    local_start: usize,
    length: usize,
) -> (usize, usize, usize)
Expand description

Compute the compressed-block access parameters for a direct seek into a YCD payload.

Given a 0-based local_start offset within a file and the number of digits to read (length), returns (block_index, offset_in_block, blocks_to_read) where:

  • block_index: 0-based index of the first 8-byte block to read.
  • offset_in_block: digits to skip at the start of the first decoded block.
  • blocks_to_read: the minimum number of blocks that cover the requested range.

This function has no side effects and is exposed for unit-testing the direct-seek logic.