Code Monkey home page Code Monkey logo

libcrc's People

Contributors

garverp avatar goutnet avatar lammertb avatar linagkar avatar property404 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  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

libcrc's Issues

How to properly work with crc16 function

Hello,

I have a string of hex numbers (in Hex representation; like "AB12F1") for which I would like to calculate (and check) the CRC sum with crc16 (the hex-string is read from a transmitted file). However, I'm unsure how to use it properly. Should I feed the function with the entire hex-string, as raw string? In the sense of, interpreting every single character of the string as byte. Or should I rather convert every hex-representation (2 hex digits) into bytes?
I tested both without any success.

I'm also unsure where I have to put the checksum - I actually tested to place it in the back of the string (as usual), but this doesn't work (results in a new CRC value, which isn't 0). Furthermore, I also tried to convert the checksum first to an ASCII representation, but this also doesn't work.

Thank you!

Embedded processors with small memory footprint

I made some modifications for an embedded project where the memory footprint is critical but the calculation time of the crc is not. I modified the calculation function so that no lookup table is used or the lookup table is read from flash memory but this is very platform specific. Is there any interest to merge that into this project?

Does not build on Ubuntu 18.04 64-bit

I pulled down the zip file today and tried to build on Ubuntu 18.04 64-bit with all updates applied.
libcrc-build-error

I assume this is because the compiler standards are a wee bit tighter now.

Use crc_ccitt_ffff for calculate from hexa data

Hello.
How i can use crc_ccitt_ffff(,) for calculation crc from hexa data? My data for crc is 890249780003A0015370C70119004FFB700039FC9FFFF4FE1EFFFFFFDDFFED00000526402A5A193DF87D50.
I need crc value 0xA9B6, but i have 0x1E66 (data calculated as ASCII). How i can fix it?

crc16 modbus

I am using MPLAB X IDE with device dspic33fj32mc304 which has inbuilt crc generator but it not gives me appropriate results for poly=0X8005; i tried all the documents provided by microchip but i don't get what i want.
in the code of crc16 modbus which i want from your site is want lookup table but there is nothing in c file or inc file.
please help me with this small issue. i uses XC16 compiler in MPLAB.
for data 01 04 00 04 00 02 crc16 modbus is 0A 30 is not achive

Does not build with gcc-7

Hi,

when using gcc-7, the lib fail to build:

$ CC=gcc-7 LINK=gcc-7 make
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crc8.o src/crc8.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crc16.o src/crc16.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crc32.o src/crc32.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crcccitt.o src/crcccitt.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crcdnp.o src/crcdnp.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crckrmit.o src/crckrmit.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/crcsick.o src/crcsick.c
gcc-7 -c -Wall -Wextra -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wredundant-decls -Wnested-externs -Werror -O3 -funsigned-char -Iinclude/ -oobj/nmea-chk.o src/nmea-chk.c
src/nmea-chk.c: In function ‘checksum_NMEA’:
src/nmea-chk.c:72:33: error: ‘%02X’ directive output may be truncated writing between 2 and 8 bytes into a region of size 3 [-Werror=format-truncation=]
  snprintf( (char *) result, 3, "%02X", checksum );
                                 ^~~~
src/nmea-chk.c:72:32: note: directive argument in the range [0, 2147483647]
  snprintf( (char *) result, 3, "%02X", checksum );
                                ^~~~~~
In file included from /usr/include/stdio.h:936:0,
                 from src/nmea-chk.c:34:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 3 and 9 bytes into a destination of size 3
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Makefile:117: recipe for target 'obj/nmea-chk.o' failed
make: *** [obj/nmea-chk.o] Error 1

Update CRC-6 Sick documentation

Could you add the information that CRC-16 Sick only checks the most significant byte to the git documentation and also to your site? I was under the impression for a few days that it was a real CRC because this information is missing.

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.