Commit ab76413b authored by Reto Da Forno's avatar Reto Da Forno
Browse files

issue with crc16 fixed (allow files larger than 256 bytes)

parent 8fe111f2
......@@ -35,7 +35,7 @@
/*---------------------------------------------------------------------------*/
/* CRC-16-IBM, CRC-16-ANSI */
uint16_t crc16(const uint8_t* data, uint8_t num_bytes, uint16_t init_value)
uint16_t crc16(const uint8_t* data, uint16_t num_bytes, uint16_t init_value)
{
uint16_t crc = init_value;
while(num_bytes) {
......@@ -47,7 +47,7 @@ uint16_t crc16(const uint8_t* data, uint8_t num_bytes, uint16_t init_value)
} else {
crc >>= 1;
}
ch >>= 1;
ch >>= 1;
bit--;
}
data++;
......
......@@ -72,7 +72,7 @@ typedef struct list_meta {
/* --- function prototypes --- */
uint16_t crc16(const uint8_t* data, uint8_t num_bytes, uint16_t init_value);
uint16_t crc16(const uint8_t* data, uint16_t num_bytes, uint16_t init_value);
uint32_t crc32(const uint8_t* data, uint32_t num_bytes, uint32_t seed);
uint32_t hexstr_to_uint32(const char* str);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment