Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Calculating CRC8 using Digest::CRC

by Athanasius (Chancellor)
on Jun 07, 2012 at 02:48 UTC ( #974862=note: print w/replies, xml ) Need Help??

in reply to Calculating CRC8 using Digest::CRC

According to the best information I have, I should be getting 234 (or EA hex) for the string 7AEE840000187A011B80C001001100119103F3267D000000000000FF00000000. Instead I am getting 236 (or EC hex).

Converting 7AEE840000187A011B80C001001100119103F3267D000000000000FF00000000 to hex in the online calculator here gives: 37414545383430303030313837413031314238304330303130303131303031313931303346333236374430303030303030303030303046463030303030303030.

Calculating the CRC-8 for this hex string in the online calculator here gives 0xec, as per your results with Digest::CRC.

So, why do you expect a result of 0xea?


Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Calculating CRC8 using Digest::CRC
by jedikaiti (Hermit) on Jun 07, 2012 at 03:47 UTC
    It was given to me by someone else whose source REALLY should be accurate. Since 2 other Monks are telling me otherwise, however, I'll be grilling him about his confidence in his source tomorrow.


    Swiss Army Nerd

      Just to be really, really clear about the point that Athanasius is making...
      The two character string '7A' consists (in ASCII) in the hex bytes 0x37 and 0x41 (the characters '7' and 'A' respectively). OTOH, it is possible to have a single character ASCII string that consists in the single hex byte 0x7A (the character 'z').
      In the example you give in your OP, which is which?

        Y'all are right, and this is why I probably should have waited until morning (or at least after dinner) to post my question... :-)

        It is not a string (I reverted to plain English, not Computer English) - 7A......0 *is* the hex.

        Mea culpa, sorry I wasn't clearer.
        Swiss Army Nerd

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://974862]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2017-10-23 01:05 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (275 votes). Check out past polls.