eternalharvest / crc32-11 Goto Github PK
View Code? Open in Web Editor NEWCRC32 implementation with c++11 generics
License: MIT License
CRC32 implementation with c++11 generics
License: MIT License
Error "template instantiation depth exceeds maximum of 300" is reported with g++ compiler.
I'm not sure why clang compiler not occurs this error though.
user@localhost:~work/crc32-11$ mkdir build
user@localhost:~work/crc32-11$ cd build
user@localhost:~work/crc32-11/build$ cmake ..
user@localhost:~work/crc32-11/build$ make
[ 50%] Building CXX object CMakeFiles/crc32++11.dir/src/main.cpp.o
In file included from /home/takuya/work/crc32-11/src/main.cpp:28:0:
/home/takuya/work/crc32-11/src/crc32.hpp: In instantiation of 'constexpr const uint32_t crc32_table_generator<79764919u>::crc32_table_elem<111u, 1u>::value':
/home/takuya/work/crc32-11/src/crc32.hpp:52:41: recursively required from 'constexpr const uint32_t crc32_table_generator<79764919u>::crc32_table_elem<111u, 7u>::value'
/home/takuya/work/crc32-11/src/crc32.hpp:62:25: recursively required from 'constexpr const auto crc32_table_generator<79764919u>::array_impl<255ul>::value'
/home/takuya/work/crc32-11/src/crc32.hpp:62:25: required from 'struct crc32_table_generator<79764919u>::array_impl<255ul>'
/home/takuya/work/crc32-11/src/crc32.hpp:72:45: required from 'constexpr const std::array<unsigned int, 256ul> crc32_table_generator<79764919u>::value'
/home/takuya/work/crc32-11/src/crc32.hpp:83:63: required from 'uint32_t crc32(uint32_t, iterator_t, iterator_t) [with unsigned int poly = 79764919u; iterator_t = std::istream_iterator<unsigned char>; uint32_t = unsigned int]'
/home/takuya/work/crc32-11/src/main.cpp:39:56: required from here
/home/takuya/work/crc32-11/src/crc32.hpp:52:41: fatal error: template instantiation depth exceeds maximum of 300 (use -ftemplate-depth= to increase the maximum)
(crc32_table_elem<index, N-1>::value << 1) ^ denominator<uint32_t, carry>::value;
^
compilation terminated.
CMakeFiles/crc32++11.dir/build.make:62: recipe for target 'CMakeFiles/crc32++11.dir/src/main.cpp.o' failed
make[2]: *** [CMakeFiles/crc32++11.dir/src/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/crc32++11.dir/all' failed
make[1]: *** [CMakeFiles/crc32++11.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Nice library. The only big issue is that can't generate standard CRC32.
IEEE8023_CRC32_POLYNOMIAL is standard, however the generated table is incorrect for it.
The first few entries must be:
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535
Your lib generates:
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2
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.