{"id":21586087,"url":"https://github.com/magiclen/crc-any","last_synced_at":"2025-04-05T19:11:21.434Z","repository":{"id":52676044,"uuid":"145953369","full_name":"magiclen/crc-any","owner":"magiclen","description":"To compute CRC values by providing the length of bits, expression, reflection, an initial value and a final xor value. It has many built-in CRC functions.","archived":false,"fork":false,"pushed_at":"2024-10-23T07:24:10.000Z","size":173,"stargazers_count":15,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T18:06:39.778Z","etag":null,"topics":["crc","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/magiclen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-08-24T06:44:21.000Z","updated_at":"2024-05-29T02:20:40.000Z","dependencies_parsed_at":"2023-12-20T13:22:34.131Z","dependency_job_id":"a91b230d-328d-4dc1-91bf-4c2235422275","html_url":"https://github.com/magiclen/crc-any","commit_stats":{"total_commits":56,"total_committers":8,"mean_commits":7.0,"dds":0.1428571428571429,"last_synced_commit":"858ec6ff89999f7172e623bbbf3ab4e7f4ea3072"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fcrc-any","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fcrc-any/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fcrc-any/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fcrc-any/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/crc-any/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386262,"owners_count":20930619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["crc","rust"],"created_at":"2024-11-24T15:12:39.027Z","updated_at":"2025-04-05T19:11:21.406Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"CRC Any\n====================\n\n[![CI](https://github.com/magiclen/crc-any/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/crc-any/actions/workflows/ci.yml)\n\nTo compute CRC values by providing the length of bits, expression, reflection, an initial value and a final xor value. It has many built-in CRC functions.\n\n## Usage\n\nYou can use `create_crc` associated function to create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value. For example, if you want to compute a CRC-24 value.\n\n```rust\nuse crc_any::CRC;\n\nlet mut crc24 = CRC::create_crc(0x0000000000864CFB, 24, 0x0000000000B704CE, 0x0000000000000000, false);\n\ncrc24.digest(b\"hello\");\n\nassert_eq!([71, 245, 138].to_vec(), crc24.get_crc_vec_be());\nassert_eq!(\"0x47F58A\", \u0026crc24.to_string());\n```\n\nTo simplify the usage, there are several common versions of CRC whose computing functions are already built-in.\n\n * crc3gsm\n * crc4itu\n * crc4interlaken\n * crc5epc\n * crc5itu\n * crc5usb\n * crc6cdma2000_a\n * crc6cdma2000_b\n * crc6darc\n * crc6gsm\n * crc6itu\n * crc7\n * crc7umts\n * crc8\n * crc8cdma2000\n * crc8darc\n * crc8dvb_s2\n * crc8ebu\n * crc8icode\n * crc8itu\n * crc8maxim\n * crc8rohc\n * crc8wcdma\n * crc10\n * crc10cdma2000\n * crc10gsm\n * crc11\n * crc12\n * crc12cdma2000\n * crc12gsm\n * crc13bbc\n * crc14darc\n * crc14gsm\n * crc15can\n * crc15mpt1327\n * crc16\n * crc16ccitt_false\n * crc16aug_ccitt\n * crc16buypass\n * crc16cdma2000\n * crc16dds_110\n * crc16dect_r\n * crc16dect_x\n * crc16dnp\n * crc16en_13757\n * crc16genibus\n * crc16maxim\n * crc16mcrf4cc\n * crc16riello\n * crc16t10_dif\n * crc16teledisk\n * crc16tms13157\n * crc16usb\n * crc_a\n * crc16kermit\n * crc16modbus\n * crc16_x25\n * crc16xmodem\n * crc17can\n * crc21can\n * crc24\n * crc24ble\n * crc24flexray_a\n * crc24flexray_b\n * crc24lte_a\n * crc24lte_b\n * crc24os9\n * crc30cdma\n * crc32\n   * It also called `crc32b` in `mhash`.\n * crc32mhash\n   * `mhash` is a common library which has two weird versions of CRC32 called `crc32` and `crc32b`. `crc32` and `crc32mhash` in this module are `crc32b` and `crc32` in mhash respectively.\n * crc32bzip2\n * crc32c\n * crc32d\n * crc32mpeg2\n * crc32posix\n * crc32q\n * crc32jamcrc\n * crc32xfer\n * crc40gsm\n * crc64\n * crc64iso\n * crc64we\n * crc64jones\n\nFor instance,\n\n```rust\nuse crc_any::CRC;\n\nlet mut crc64 = CRC::crc64();\n\ncrc64.digest(b\"hello\");\n\nassert_eq!([64, 84, 74, 48, 97, 55, 182, 236].to_vec(), crc64.get_crc_vec_be());\nassert_eq!(\"0x40544A306137B6EC\", \u0026crc64.to_string());\n```\n\nAfter getting a CRC value, you can still use the `digest` method to continue computing the next CRC values.\n\n## Heapless Support\n\nTo make sure this crate will not use heap memory allocation, you can disable the default features.\n\n```toml\n[dependencies.crc-any]\nversion = \"*\"\ndefault-features = false\n```\n\nAfter doing that, the `get_crc_vec_be` and `get_crc_vec_le` methods can not be used. But if you still need this crate to return a `Vec` without dynamic allocation, you can enable the `heapless` feature to make the `get_crc_heapless_vec_be` and `get_crc_heapless_vec_le` methods available.\n\n```toml\n[dependencies.crc-any]\nversion = \"*\"\ndefault-features = false\nfeatures = [\"heapless\"]\n```\n\n## Crates.io\n\nhttps://crates.io/crates/crc-any\n\n## Documentation\n\nhttps://docs.rs/crc-any\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fcrc-any","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Fcrc-any","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fcrc-any/lists"}