software/filesrv/filesrv_shared.c
// BSD-style 8-bit checksum
BSD-style 8-bit checksum
BSD - style 8 - bit checksum
uint8_t checksum8(uint8_t* datptr, uint32_t len)
{
    uint8_t sum = 0;
    for (uint32_t i = 0; i < len; i++) {
        sum = (sum >> 1) | ((sum & 1) << 7);
        sum += datptr[i];
    }
    return sum;
}
uint8_t checksum8 ( uint8_t * datptr , uint32_t len ) { uint8_t sum = 0 ; for ( uint32_t i = 0 ; i < len ; i ++ ) { sum = ( sum >> 1 ) | ( ( sum & 1 ) << 7 ) ; sum += datptr [ i ] ; } return sum ; }
BSD-style 8-bit checksum
BSD - style 8 - bit checksum