CRC 연산을 해야 하는데 필요한 함수나 라이브러리가 있을까요? 함수를 완전 작성하기에는 알고리즘을 이해하기가 어렵고 해서 CRC8로 된것을 분석하는데 필요해서요
http://bbs.kldp.org/viewtopic.php?t=41622
사용 언어가 C++ 이면 boost::crc_optimal<> 를 사용하세요.
http://boost.org/libs/crc/index.html
예제 입니다.
#include <boost/crc.hpp> // for boost::crc_basic, boost::crc_optimal #include <boost/cstdint.hpp> // for boost::uint16_t #include <algorithm> // for std::for_each #include <cassert> // for assert #include <cstddef> // for std::size_t #include <iostream> // for std::cout #include <ostream> // for std::endl // Main function int main () { // This is "123456789" in ASCII unsigned char const data[] = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 }; std::size_t const data_len = sizeof( data ) / sizeof( data[0] ); // The expected CRC for the given data boost::uint16_t const expected = 0x29B1; // Simulate CRC-CCITT boost::crc_basic<16> crc_ccitt1( 0x1021, 0xFFFF, 0, false, false ); crc_ccitt1.process_bytes( data, data_len ); assert( crc_ccitt1.checksum() == expected ); // Repeat with the optimal version (assuming a 16-bit type exists) boost::crc_optimal<16, 0x1021, 0xFFFF, 0, false, false> crc_ccitt2; crc_ccitt2 = std::for_each( data, data + data_len, crc_ccitt2 ); assert( crc_ccitt2() == expected ); std::cout << "All tests passed." << std::endl; return 0; }
----------------------------------------http://moim.athttp://mkhq.co.kr
사용언어게 Verilog라면 ftp://ftp.rfc-editor.org/in-notes/rfc3385.txt
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
http://bbs.kldp.org/viewtopic.php?t=4162
http://bbs.kldp.org/viewtopic.php?t=41622
사용 언어가 C++ 이면 boost::crc_optimal<>
사용 언어가 C++ 이면 boost::crc_optimal<> 를 사용하세요.
http://boost.org/libs/crc/index.html
예제 입니다.
----------------------------------------
http://moim.at
http://mkhq.co.kr
사용언어게 Verilog라면 ftp://ftp.rfc-editor.org
사용언어게 Verilog라면 ftp://ftp.rfc-editor.org/in-notes/rfc3385.txt
댓글 달기