Skip to content

How to properly work with crc16 function #23

@bilaljo

Description

@bilaljo

Hello,

I have a string of hex numbers (in Hex representation; like "AB12F1") for which I would like to calculate (and check) the CRC sum with crc16 (the hex-string is read from a transmitted file). However, I'm unsure how to use it properly. Should I feed the function with the entire hex-string, as raw string? In the sense of, interpreting every single character of the string as byte. Or should I rather convert every hex-representation (2 hex digits) into bytes?
I tested both without any success.

I'm also unsure where I have to put the checksum - I actually tested to place it in the back of the string (as usual), but this doesn't work (results in a new CRC value, which isn't 0). Furthermore, I also tried to convert the checksum first to an ASCII representation, but this also doesn't work.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions