There are 3 different CRC-5 standards: https://en.wikipedia.org/wiki/Cyclic_redundancy_check#Commonly_used_and_standardized_CRCs

Ideal if you can identify which one so the function can later be moved to util.c if shared.