Giter Site home page Giter Site logo

Comments (5)

Brandonn-Etheve avatar Brandonn-Etheve commented on July 30, 2024 1

Thanks for your time.
since there was a comment in the example sketch : // Serial.println("Verified with - https://crccalc.com/\n");
i though that the default setting should match the output of that website.

Using:
crc.setPolynome(0x04C11DB7);
crc.setStartXOR(0xFFFFFFFF);
crc.setEndXOR(0xFFFFFFFF);
crc.setReverseIn(true);
crc.setReverseOut(true);

the output is CBF43926 as expected.
since many website use those setting (including https://crc32.online/ and other) maybe you should use it as default setting, or add the link to http://zorc.breitbandkatze.de/crc.html instead of https://crccalc.com in the sketch comment.
Anyways issue solved.

from crc.

RobTillaart avatar RobTillaart commented on July 30, 2024

I'll have a look
...

Got the same results as you (so it is at least consistent)
CRC32_test.ino
89A1897F
89A1897F
89A1897F
CDBAC17A
18

These are the settings, these are NOT in the table at crccalc.com

void CRC32::reset()
{
  _polynome   = CRC32_DEFAULT_POLYNOME;  (== 0x04C11DB7)
  _startMask  = 0;
  _endMask    = 0;
  _crc        = 0;
  _reverseIn  = false;
  _reverseOut = false;
  _started    = false;
  _count      = 0;
}

Checking with - http://zorc.breitbandkatze.de/crc.html
and values seems OK.

image

Think you missed the XOR with 0xFFFFFF at the end (in the crccalc table)

from crc.

RobTillaart avatar RobTillaart commented on July 30, 2024

CDBAC17A is the CRC-32 when adding the string 123456789 twice.

from crc.

RobTillaart avatar RobTillaart commented on July 30, 2024

Good point to use at least a setting that is in the table.
I'll make a note of it for a next release to improve the examples.

Might be useful to have a dump() function to print all settings at once. => easier to check them.

from crc.

RobTillaart avatar RobTillaart commented on July 30, 2024

FYI triggered by your question I created a 0.2.0 version

  • Added getters for the parameters in the CRC classes so they become easier to verify programmatically.
  • Reduced the calls to yield() in add(array, length) to improve performance.
    now one in every 256 additions yield is called()..
  • minor edits.

from crc.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.