View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 354
|
crc calc. |
Posted: Tue Jan 24, 2023 7:13 am |
|
|
Hello all,
I'm trying to decode crc algorithm with this data:
Code: |
"I1:8:00:00:5A99"
"I1:8:00:01:4341"
|
where "5A99" and "4341" are crc from 'I' to last ':'
Can anyone help? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Tue Jan 24, 2023 7:36 am |
|
|
I'd go to whoever CREATED the 'line of data'. It appears to be 3 elements that are from something called 'I1' ??
The CRC is just a calculation that someone does on some data,usually to produce a 'checksum' to validate that data after transmitting it from 'here to there'. While you might be able to 'reverse engineer' it, having only 2 datasets probably isn't enough.
one possible way...
https://reveng.sourceforge.io/
2 data will produce 3 possible results
3 data should give 1 result
No, I've not used this program...
just curious... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Tue Jan 24, 2023 8:22 am |
|
|
As Jay says, you need slightly more data to be sure of the results.
Also in fact, since you don't know if the source data is being treated as
ASCII, and including the colons, or ASCII without these, or as hex values,
you will have to try all these to possibly find a solution.
Problem is that for all the well known CRC formulae, there are hundreds
of other possibilities that 'may' exist. Normally a CRC is a polynomial
calculation, and you have the polynomial being used (dozens of possibilities),
and the seed value used to start (potentially for a 16bit equation up to
65536 possibilities). There are also though other calculations that could
be used, not employing the standard formulae. |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 354
|
|
Posted: Tue Jan 24, 2023 9:29 am |
|
|
Hi,
I think data are treated as hex including colons and result is printed as ASCII, because I've decoding similar packet from the same device.
Okay,
Thanks for suggestion! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Tue Jan 24, 2023 10:01 am |
|
|
'thinking' and KNOWING are different.
You can easily 'think' you have the CRC algorithm and 'think' that the data is good but you have to do a LOT of tests to confirm and KNOW it is correct. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Tue Jan 24, 2023 10:48 am |
|
|
You can't treat it as 'hex including the colons', since a colon is not a hex
character. I suspect you mean as ASCII, so the sequence:
31 3A 38 3A 30 30 3A 30 30 3A
Doesn't give the 5A99 result from any of the standard CRC algorithms.
If you have 'decoded similar packets', then try the CRC algorithm you
used for these.
If this is coming from a 'device', then where is the data for this?. This
is what will tell you how the calculation is done. Wasting time otherwise. |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 354
|
|
Posted: Tue Jan 24, 2023 12:23 pm |
|
|
* Yes mr. Ttelmah I mean ascii "31 3A 38 3A 30 30 3A 30 30 3A "
* Yes I have tried 'standard' algorithms.
Because the data that is changing is only second pair "00" ("00" to "FF") I have made crc lookup table with 256 words.
For now this lookup tab. Will do the job that is required.
Thanks & Best Wishes, |
|
|
|