Skip to main content

bch_code_for_length

Function bch_code_for_length 

Source
pub fn bch_code_for_length(data_part_len: usize) -> Option<BchCode>
Expand description

Determine the BchCode variant from a total data-part length.

Boundaries are from BIP 93 (codex32): regular code BCH(93,80,8) caps at 93, long code BCH(108,93,8) runs 96–108, and lengths 94–95 are explicitly reserved-invalid to prevent ambiguity in code-variant selection. Lengths below 14 or above 108 are also rejected.