Code Monkey home page Code Monkey logo

crc32c's People

Contributors

cwlbraa avatar htot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

crc32c's Issues

hanging submodule

you've got no .gitmodules file, and yet there's a gitlink for crc32c/crc32c/crc32c, which is fragile for anyone who might want to submodule in your lovely implementation...

Results Don't Agree with zlib

Although the crc32c results I'm seeing are consistent with the tests in this library, they do not agree with the crc32 results of other libraries, such as zlib:

#include <crc32c/crc32c.h>
#include <zlib.h>

unsigned long crc_zlib = crc32(0L, Z_NULL, 0);
std::string test_string = "hello-world";
uint32_t truth = 2983461467;
const auto test_string_chars = reinterpret_cast<const unsigned char*>(test_string.c_str());
crc_zlib = crc32(crc_zlib, (const unsigned char*)test_string_chars, test_string.length()); // this is zlib

uint32_t crc_c = crc32c::Crc32c(test_string); // 
std::cout << "truth: " << truth << ", zlib: " << crc_zlib << ", crc32c: " << crc_c << std::endl;

produces the output:

truth: 2983461467, zlib: 2983461467, crc32c: 4099351003

Calling the same with test_string = "The quick brown fox jumps over the lazy dog" produces the output:

truth: 576848900, zlib: 1095738169, crc32c: 576848900

You can see the short phrase "The quick brown fox..." produces the same crc as in your tests, but it does not agree with zlib. The zlib result on "hello-world" agrees with all of the sources listed here.

I thought perhaps there was a difference in what was being calculated, such as returning the signed 32-bit crc rather than unsigned, but it is indeed returning a unit32_t, so that wouldn't explain it.

This is a Google Cloud Compute instance with haswell Intel architecture. When I build the project, running ./crc32c_test shows all tests PASSED.

Do you have any guidance on what the discrepancy may be? Thanks!

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.