Module cusip::checksum

source ·
Expand description

§cusip::checksum

Implementation of the checksum algorithm for CUSIP

Functions§

  • Compute the checksum for a u8 array. No attempt is made to ensure the input string is in the CUSIP payload format or length.
  • This version iterates from right to left, the same way the algorithm works for the isin crate. For an input of even length (in this case, 8), deciding even-vs-odd from left-to-right with one-based indexing is equivalent to deciding from right-to-left with zero-based indexing. We are using the latter to emphasize the similarities with the ISIN algorithm, even though there are important differences.