{"id":46858085,"url":"https://github.com/embetech-official/crc","last_synced_at":"2026-03-10T17:36:54.125Z","repository":{"id":280415972,"uuid":"736947414","full_name":"embetech-official/crc","owner":"embetech-official","description":"Lightweight CRC library","archived":false,"fork":false,"pushed_at":"2026-01-15T14:14:35.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-15T18:15:44.937Z","etag":null,"topics":["c","cpp","library","utility"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embetech-official.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-29T10:43:25.000Z","updated_at":"2026-01-15T14:14:40.000Z","dependencies_parsed_at":"2025-03-03T10:31:09.975Z","dependency_job_id":"9ae040e6-278e-4528-82c4-6154992670e0","html_url":"https://github.com/embetech-official/crc","commit_stats":null,"previous_names":["embetech-official/crc"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/embetech-official/crc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetech-official%2Fcrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetech-official%2Fcrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetech-official%2Fcrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetech-official%2Fcrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embetech-official","download_url":"https://codeload.github.com/embetech-official/crc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embetech-official%2Fcrc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30344708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpp","library","utility"],"created_at":"2026-03-10T17:36:53.534Z","updated_at":"2026-03-10T17:36:54.113Z","avatar_url":"https://github.com/embetech-official.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRC\n\n[![CI Tests](https://github.com/embetech-official/crc/actions/workflows/on_push.yml/badge.svg)](https://github.com/embetech-official/crc/actions/workflows/on_push.yml)\n![GitHub License](https://img.shields.io/github/license/embetech-official/crc)\n![GitHub Release](https://img.shields.io/github/v/release/embetech-official/crc)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b8de2d81aca841dcb9f8c44d48c68b3e)](https://app.codacy.com/gh/embetech-official/crc/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n\n## Overview\n\nCRC is a small C library for calculating 8/16/32-bit checksums using standard, well-known polynomials. It provides simple, dependency-free functions and optional LUT-accelerated variants.\n\n## Supported Polynomials\n\n- CRC8-ITU (Poly 0x07, Init 0x00, no input/output bit reflection, XorOut 0x55)\n- CRC16-CCITT BLUETOOTH CCITT-TRUE V-41-LSB KERMIT (Poly 0x1021, Init 0x0000, input/output bit reflection, XorOut 0x0000)\n- CRC16-MODBUS (Poly 0x8005, Init 0xFFFF, input/output bit reflection, XorOut 0x0000)\n- CRC32-POSIX/cksum (Poly 0x04C11DB7, Init 0x00000000, no input/output bit reflection, XorOut 0xFFFFFFFF)\n\n## Core APIs\n\nHeaders:\n\n- `embetech/crc8.h`\n- `embetech/crc16.h`\n- `embetech/crc32.h`\n\nVersion helper:\n\n- `CRC_GetVersionString()` in `embetech/crc.h`\n\nRepresentative functions:\n\n- CRC-8 (ITU): `CRC8_ITU_Init`, `CRC8_ITU_UpdateUsingFormula`, `CRC8_ITU_UpdateUsingLut`, `CRC8_ITU_Finalize`\n- CRC-16 CCITT: `CRC16_CCITT_Init`, `CRC16_CCITT_UpdateUsingFormula`, `CRC16_CCITT_UpdateUsingLut`, `CRC16_CCITT_Finalize`\n- CRC-16 MODBUS: `CRC16_MODBUS_Init`, `CRC16_MODBUS_UpdateUsingFormula`, `CRC16_MODBUS_UpdateUsingLut`, `CRC16_MODBUS_Finalize`\n- CRC-32 POSIX/cksum: `CRC32_CKSUM_Init`, `CRC32_CKSUM_UpdateUsingFormula`, `CRC32_CKSUM_UpdateUsingLut`, `CRC32_CKSUM_Finalize`\n\n## Installation\n\nThis project uses CPM.cmake for source consumption and also supports installable CMake package metadata.\n\nUsing CPM.cmake in your project:\n\n```cmake\n# Download CPM.cmake (pin version as needed)\nfile(DOWNLOAD\n  https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.42.0/CPM.cmake\n  ${CMAKE_BINARY_DIR}/cmake/CPM.cmake\n  EXPECTED_HASH SHA256=2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a\n)\ninclude(${CMAKE_BINARY_DIR}/cmake/CPM.cmake)\n\n# Add crc (pin to a released tag or major stream)\nCPMAddPackage(\"gh:embetech-official/crc@2\")\n\nadd_executable(app main.c)\ntarget_link_libraries(app PRIVATE embetech::crc)\n```\n\nInclude headers via:\n\n```c\n#include \u003cembetech/crc.h\u003e\n#include \u003cembetech/crc8.h\u003e\n#include \u003cembetech/crc16.h\u003e\n#include \u003cembetech/crc32.h\u003e\n```\n\n## Build\n\nUse CMake Presets (Ninja Multi-Config) for a streamlined workflow:\n\n```sh\ncmake --workflow --preset native-gcc\n```\n\nThe workflow configures, builds Debug, runs tests, and installs Debug+Release.\n\n## Options\n\n- `CRC_TESTS` (default: ON if top-level): Builds unit tests (GoogleTest via CPM).\n- `CRC_DOC` (default: ON if top-level): Builds Doxygen docs.\n- `CRC_EXAMPLES` (default: ON if top-level): Builds example targets.\n- `CRC_INSTALL` (default: ON): Enables install targets and generates CMake package config files.\n\nConfigure-time overrides, for example:\n\n```sh\ncmake --preset native-gcc -D CRC_TESTS=ON -D CRC_DOC=OFF -D CRC_EXAMPLES=ON\n```\n\n## Dependencies\n\n- Runtime: none.\n- Tests: `google/googletest` (fetched via CPM when tests are enabled).\n- Optional: if `embetile` is available, an additional API file is compiled and linked automatically.\n\n## Usage Example\n\nMinimal example computing CRC-8, CRC-16 CCITT, and CRC-32 checksums:\n\n```c\n#include \u003cembetech/crc8.h\u003e\n#include \u003cembetech/crc16.h\u003e\n#include \u003cembetech/crc32.h\u003e\n\nint main(void) {\n  unsigned char data[100] = {0};\n\n  // CRC-8 ITU (formula or LUT variant)\n  uint8_t c8 = CRC8_ITU_Init();\n  c8 = CRC8_ITU_UpdateUsingLut(data, sizeof(data), c8);\n  c8 = CRC8_ITU_Finalize(c8);\n\n  // CRC-16 CCITT\n  uint16_t c16 = CRC16_CCITT_Init();\n  c16 = CRC16_CCITT_UpdateUsingLut(data, sizeof(data), c16);\n  c16 = CRC16_CCITT_Finalize(c16);\n\n  // CRC-32 POSIX/cksum\n  uint32_t c32 = CRC32_CKSUM_Init();\n  c32 = CRC32_CKSUM_UpdateUsingLut(data, sizeof(data), c32);\n  c32 = CRC32_CKSUM_Finalize(c32);\n\n  (void)c8; (void)c16; (void)c32;\n  return 0;\n}\n```\n\n## Versioning\n\n`CRC_GetVersionString()` returns the library version string. When built at the repository top-level, a short git commit id is appended (e.g., `X.Y.Z+abcdef12`).\n\n## Contributing\n\nIssues and PRs are welcome. Please use the provided presets to build, run tests, and keep changes focused.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembetech-official%2Fcrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembetech-official%2Fcrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembetech-official%2Fcrc/lists"}