Giter VIP home page Giter VIP logo

crc's People

Contributors

djipi avatar endrii avatar mygityf 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

crc's Issues

Improper argument types result in Undefined Behavior

Hello,

There is an issue with argument types for the whole set of CRC functions. For example, the following input buffer would result in the improper CRC calculation:

    const uint8_t buffer[] = {0xb0, 0, 0, 0, 0, 0, 0};

    expect = 0x1a;
    EXPECT_EQ(crc8_lsb((const char *)buffer, sizeof(buffer)), expect);

On my machine the test fails with the following issue:

failed: Expect:3f == Actual:1a

The issue with signed characters that current interface expects: 0xb0 is -80 as char. Thus, this code leads to negative array index access:

crc = crc8tab_lsb[crc ^ *buf++];
// On the veriy first step crc ^ *buf = -80

嵌入式linux CRC32校验值和服务器linux CRC32校验值不一样

(都是**人哈,就不说外国话了)

同一个串

7F 7E 00 00 00 
00 08 00 00 00 
00 04 1D 00 09

在嵌入式 (arm 新唐)中

# 你的crc32
crc=294be25
# 我另外用的一个库crc32
crc=fd6b41db

在服务器(ubuntu 16)中

# 你的crc32
crc=fd6b41db
# 我另外用的一个库crc32
crc=fd6b41db

哈哈,我还以为源码没问题,卡了我一点时间,最后发现是源码问题

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.