fn fletcher16(data: &[u8]) -> u16 {
    let mut sum1: u16 = 0;
    let mut sum2: u16 = 0;

    for byte in data {
        sum1 = (sum1 + *byte as u16) % 255;
        sum2 = (sum2 + sum1) % 255;
    }

    (sum2 << 8) | sum1
}
/// Computes the fletcher16 checksum, copied from wikipedia: <https://en.wikipedia.org/wiki/Fletcher%27s_checksum>
Computes the fletcher16 checksum, copied from wikipedia.
Computes the fletcher16 checksum copied from wikipedia .
fn fletcher16(data: &[u8]) -> u16 {
    let mut sum1: u16 = 0;
    let mut sum2: u16 = 0;
    for byte in data {
        sum1 = (sum1 + *byte as u16) % 255;
        sum2 = (sum2 + sum1) % 255;
    }
    (sum2 << 8) | sum1
}
fn fletcher16 ( data : & [ u8 ] ) -> u16 { let mut sum1 : u16 = 0 ; let mut sum2 : u16 = 0 ; for byte in data { sum1 = ( sum1 + * byte as u16 ) % 255 ; sum2 = ( sum2 + sum1 ) % 255 ; } ( sum2 << 8 ) | sum1 }
Computes the fletcher16 checksum, copied from wikipedia: <https://en.wikipedia.org/wiki/Fletcher%27s_checksum>
Computes the fletcher16 checksum copied from wikipedia : <https : // en . wikipedia . org / wiki / Fletcher%27s_checksum >
data
&[u8]
data
&[u8]