gityf / crc Goto Github PK
View Code? Open in Web Editor NEWcrc16/crc32/crc64
crc16/crc32/crc64
for example MIT or BSD 2 clause
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
(都是**人哈,就不说外国话了)
同一个串
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
哈哈,我还以为源码没问题,卡了我一点时间,最后发现是源码问题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.