Skip to main content

polymod_run

Function polymod_run 

Source
pub fn polymod_run(values: &[u8]) -> u128
Expand description

Run the BCH polymod over values starting from the BIP-93 initial residue.

Returns the final residue; callers XOR against the per-HRP target constant (MS_REGULAR_CONST) to produce a checksum or to verify one. Inputs are 5-bit symbols (u8 in 0..32); larger values are reduced modulo 32 by the underlying step.