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

Re: Calculating CRC8 using Digest::CRC

by Athanasius (Prior)
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?

HTH,

Athanasius <°(((><contra mundum


Comment on Re: Calculating CRC8 using Digest::CRC
Re^2: Calculating CRC8 using Digest::CRC
by jedikaiti (Friar) 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.

    Thanks!

    Kaiti
    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.
        Kaiti
        Swiss Army Nerd

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://974862]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-04-18 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (462 votes), past polls