CRC
-
Hi Experts, I am in a confusion.Please guide me. I am writing a code to get a string from RCR32 value I know different string may have same CRC, It is not a issue. I need to get the string(whatever) for CRC. I am creating the string combination of length 1 to n and calculating the CRC of that string and matching the CRC with desired CRC. But this is very slow method. What the the fastest algorithm I should adopt to do so?
-
Hi Experts, I am in a confusion.Please guide me. I am writing a code to get a string from RCR32 value I know different string may have same CRC, It is not a issue. I need to get the string(whatever) for CRC. I am creating the string combination of length 1 to n and calculating the CRC of that string and matching the CRC with desired CRC. But this is very slow method. What the the fastest algorithm I should adopt to do so?
AFAIK there is no algorithm for "reverse CRC", other than the brute-force approach you are already taking. So what remains to be done is choosing a fast implementation. One can speed up CRC calculations a lot by using a table-based scheme. Here [^]is one. BTW: there are a lot of CRC schemes, each resulting in a different CRC value for a given set of data! :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
Hi Experts, I am in a confusion.Please guide me. I am writing a code to get a string from RCR32 value I know different string may have same CRC, It is not a issue. I need to get the string(whatever) for CRC. I am creating the string combination of length 1 to n and calculating the CRC of that string and matching the CRC with desired CRC. But this is very slow method. What the the fastest algorithm I should adopt to do so?
You may do some reverse engineering to get String from CRC. Although that's not feasible. CRC produce unique set of bytes for any data (in your case it is string). As you mentioned correctly, it may not be Unique. The process is slow unless you know how to optimize it. One more method is to use MD5 or SHA1. Although the whole purpose of MD5 is to authenticate the data (and it uses Hash function - which may take extra clock cycles), it can also be used smartly to replace CRC. There is a exhaustive list of error-correcting algorithm which I am not mentioning here. Pick any of those according to the importance of the transfered data. (CRC converts data => Checksums so the only way we can get data be CRC is by trial and error) CHEERS!!!