RobTillaart / CRC

CRC library for Arduino
MIT License
79 stars 17 forks source link

added const in parameters. #12

Closed RobTillaart closed 2 years ago

RobTillaart commented 2 years ago

changed all lengths to uint8_t.

ModischFabrications commented 2 years ago

Looks good and should accept string inputs.

I am not sure what effect the const bool / const uint8_t have though, as they are passed by value. You could omit them.

RobTillaart commented 2 years ago

Const bool /uint8 is indeed passed by value . the compiler may optimise the code to the max.

On AVR i did not see differences in code size or performance. Also replacing length by a local counter did not change timing

Apparently compiler is smart enough to recognize the optimizations