Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CRC

CRC

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmshelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    john5632
    wrote on last edited by
    #1

    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?

    L V 2 Replies Last reply
    0
    • J john5632

      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?

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • J john5632

        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?

        V Offline
        V Offline
        varunpandeyengg
        wrote on last edited by
        #3

        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!!!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups