Skip to main content

automatic_length

Function automatic_length 

Source
pub fn automatic_length(count: u64) -> usize
Expand description

What: The length Git starts from for a repository of count packed objects. Why: About 2^bits objects expect a collision at 2^(bits/2); four bits make a character, and small repositories keep the fallback.

In TS you’d write (pseudocode):

Math.max(7, Math.ceil((msb(count) + 1) / 2))