I have a file containing data in HEX.

example:

@0000 FF FF FF 02 24 E0 02 26 A9 02 21 B0 02 21 53 02

@0010 21 6A 02 21 EE 02 21 F5 02 25 55 02 22 7B 02 23

@0090 D2 AF D2 B8 75 1F 01 12 0B B1 75 15 00 E5 0B 20

etc..

I need to calculate the CRC for this data:

my poly is non-standard.

P=1edc6f41

init value = 0xFFFFFFFF

I'm going to use the digect::CRC to do it and I want some kind of a model as a reference to know that I do it correctly.

By the way, as far as I understand, the digest::CRC consider the data as an ASCII string.

Meaning it takes each char, gets it ascii value, and then convert it to BIN.

This is not what I need.

Ineed it to take the chars and consider them as a HEX value, and just convert them to BIN.

Any idea on how I should achive it?

Thx a lot

Guy.


In reply to Re^4: How to use perl digest module to calculate CRC? by guyra
in thread How to use perl digest module to calculate CRC? by guyra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.