Function generate_radix_bases

Source
const fn generate_radix_bases(max: u64) -> [(u64, usize); 257]
Expand description

Generate tables of the greatest power of each radix that is less that the given maximum. These are returned from get_radix_base to batch the multiplication/division of radix conversions on full BigUint values, operating on primitive integers as much as possible.

e.g. BASES_16[3] = (59049, 10) // 3¹⁰ fits in u16, but 3¹¹ is too big BASES_32[3] = (3486784401, 20) BASES_64[3] = (12157665459056928801, 40)

Powers of two are not included, just zeroed, as they’re implemented with shifts.