wdtj has asked for the wisdom of the Perl Monks concerning the following question:
The example in the spec shown for the header: 05 64 05 F2 01 00 00 00 the checksum should be 52 0C. I get x=91fc. I've tried playing with all the parameters but can't seem to get it to come out. Any suggestions?my $ctx = Digest::CRC->new(width=>16, init=>0, xorout=>0xffff, refin=>1, refout=>1, poly=>0x3d65, cont=>0xea82); $ctx->add(0x05); $ctx->add(0x64); $ctx->add(0x05); $ctx->add(0xF2); $ctx->add(0x01); $ctx->add(0x00); $ctx->add(0x00); $ctx->add(0x00); my $x=$ctx->digest; printf("x=%04x\n",$x);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Digest::CRC to calculate DNP3 checksums
by dasgar (Priest) on Sep 08, 2016 at 05:34 UTC | |
|
Re: Using Digest::CRC to calculate DNP3 checksums
by Corion (Patriarch) on Sep 07, 2016 at 17:56 UTC | |
|
Re: Using Digest::CRC to calculate DNP3 checksums
by Anonymous Monk on Sep 07, 2016 at 21:06 UTC |