crc.h 66.8 KB
Newer Older
D
dongzhihong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899
//   Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
    @file CRC.h
    @author Daniel Bahr
    @version 0.2.0.6
    @copyright
    @parblock
        CRC++
        Copyright (c) 2016, Daniel Bahr
        All rights reserved.

        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are
   met:

        * Redistributions of source code must retain the above copyright notice,
   this
          list of conditions and the following disclaimer.

        * Redistributions in binary form must reproduce the above copyright
   notice,
          this list of conditions and the following disclaimer in the
   documentation
          and/or other materials provided with the distribution.

        * Neither the name of CRC++ nor the names of its
          contributors may be used to endorse or promote products derived from
          this software without specific prior written permission.

        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
   IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
   THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
   THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    @endparblock
*/

/*
    CRC++ can be configured by setting various #defines before #including this
   header file:

        #define crcpp_uint8                             - Specifies the type
   used to store CRCs that have a width of 8 bits or less.
                                                          This type is not used
   in CRC calculations. Defaults to ::std::uint8_t.
        #define crcpp_uint16                            - Specifies the type
   used to store CRCs that have a width between 9 and 16 bits (inclusive).
                                                          This type is not used
   in CRC calculations. Defaults to ::std::uint16_t.
        #define crcpp_uint32                            - Specifies the type
   used to store CRCs that have a width between 17 and 32 bits (inclusive).
                                                          This type is not used
   in CRC calculations. Defaults to ::std::uint32_t.
        #define crcpp_uint64                            - Specifies the type
   used to store CRCs that have a width between 33 and 64 bits (inclusive).
                                                          This type is not used
   in CRC calculations. Defaults to ::std::uint64_t.
        #define crcpp_size                              - This type is used for
   loop iteration and function signatures only. Defaults to ::std::size_t.
        #define CRCPP_USE_NAMESPACE                     - Define to place all
   CRC++ code within the ::CRCPP namespace.
        #define CRCPP_BRANCHLESS                        - Define to enable a
   branchless CRC implementation. The branchless implementation uses a single
   integer
                                                          multiplication in the
   bit-by-bit calculation instead of a small conditional. The branchless
   implementation
                                                          may be faster on
   processor architectures which support single-instruction integer
   multiplication.
        #define CRCPP_USE_CPP11                         - Define to enables
   C++11 features (move semantics, constexpr, static_assert, etc.).
        #define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS  - Define to include
   definitions for little-used CRCs.
*/

#ifndef CRCPP_CRC_H_
#define CRCPP_CRC_H_

#include <climits>  // Includes CHAR_BIT
#ifdef CRCPP_USE_CPP11
#include <cstddef>  // Includes ::std::size_t
#include <cstdint>  // Includes ::std::uint8_t, ::std::uint16_t, ::std::uint32_t, ::std::uint64_t
#else
#include <stddef.h>  // Includes size_t
#include <stdint.h>  // Includes uint8_t, uint16_t, uint32_t, uint64_t
#endif
#include <limits>   // Includes ::std::numeric_limits
#include <utility>  // Includes ::std::move

#ifndef crcpp_uint8
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 8-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint8 ::std::uint8_t
#else
/// @brief Unsigned 8-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint8 uint8_t
#endif
#endif

#ifndef crcpp_uint16
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 16-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint16 ::std::uint16_t
#else
/// @brief Unsigned 16-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint16 uint16_t
#endif
#endif

#ifndef crcpp_uint32
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 32-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint32 ::std::uint32_t
#else
/// @brief Unsigned 32-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint32 uint32_t
#endif
#endif

#ifndef crcpp_uint64
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned 64-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint64 ::std::uint64_t
#else
/// @brief Unsigned 64-bit integer definition, used primarily for parameter
/// definitions.
#define crcpp_uint64 uint64_t
#endif
#endif

#ifndef crcpp_size
#ifdef CRCPP_USE_CPP11
/// @brief Unsigned size definition, used for specifying data sizes.
#define crcpp_size ::std::size_t
#else
/// @brief Unsigned size definition, used for specifying data sizes.
#define crcpp_size size_t
#endif
#endif

#ifdef CRCPP_USE_CPP11
/// @brief Compile-time expression definition.
#define crcpp_constexpr constexpr
#else
/// @brief Compile-time expression definition.
#define crcpp_constexpr const
#endif

#ifdef CRCPP_USE_NAMESPACE
namespace CRCPP {
#endif

/**
    @brief Static class for computing CRCs.
    @note This class supports computation of full and multi-part CRCs, using a
   bit-by-bit algorithm or a
        byte-by-byte lookup table. The CRCs are calculated using as many
   optimizations as is reasonable.
        If compiling with C++11, the constexpr keyword is used liberally so that
   many calculations are
        performed at compile-time instead of at runtime.
*/
class CRC {
public:
  // Forward declaration
  template <typename CRCType, crcpp_uint16 CRCWidth>
  struct Table;

  /**
      @brief CRC parameters.
  */
  template <typename CRCType, crcpp_uint16 CRCWidth>
  struct Parameters {
    CRCType polynomial;    ///< CRC polynomial
    CRCType initialValue;  ///< Initial CRC value
    CRCType finalXOR;      ///< Value to XOR with the final CRC
    bool reflectInput;     ///< true to reflect all input bytes
    bool reflectOutput;  ///< true to reflect the output CRC (reflection occurs
                         /// before the final XOR)

    Table<CRCType, CRCWidth> MakeTable() const;
  };

  /**
      @brief CRC lookup table. After construction, the CRC parameters are fixed.
      @note A CRC table can be used for multiple CRC calculations.
  */
  template <typename CRCType, crcpp_uint16 CRCWidth>
  struct Table {
    // Constructors are intentionally NOT marked explicit.
    Table(const Parameters<CRCType, CRCWidth> &parameters);

#ifdef CRCPP_USE_CPP11
    Table(Parameters<CRCType, CRCWidth> &&parameters);
#endif

    const Parameters<CRCType, CRCWidth> &GetParameters() const;

    const CRCType *GetTable() const;

    CRCType operator[](unsigned char index) const;

  private:
    void InitTable();

    Parameters<CRCType, CRCWidth>
        parameters;  ///< CRC parameters used to construct the table
    CRCType table[1 << CHAR_BIT];  ///< CRC lookup table
  };

  // The number of bits in CRCType must be at least as large as CRCWidth.
  // CRCType must be an unsigned integer type or a custom type with operator
  // overloads.
  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType Calculate(const void *data,
                           crcpp_size size,
                           const Parameters<CRCType, CRCWidth> &parameters);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType Calculate(const void *data,
                           crcpp_size size,
                           const Parameters<CRCType, CRCWidth> &parameters,
                           CRCType crc);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType Calculate(const void *data,
                           crcpp_size size,
                           const Table<CRCType, CRCWidth> &lookupTable);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType Calculate(const void *data,
                           crcpp_size size,
                           const Table<CRCType, CRCWidth> &lookupTable,
                           CRCType crc);

// Common CRCs up to 64 bits.
// Note: Check values are the computed CRCs when given an ASCII input of
// "123456789" (without null terminator)
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint8, 4> &CRC_4_ITU();
  static const Parameters<crcpp_uint8, 5> &CRC_5_EPC();
  static const Parameters<crcpp_uint8, 5> &CRC_5_ITU();
  static const Parameters<crcpp_uint8, 5> &CRC_5_USB();
  static const Parameters<crcpp_uint8, 6> &CRC_6_CDMA2000A();
  static const Parameters<crcpp_uint8, 6> &CRC_6_CDMA2000B();
  static const Parameters<crcpp_uint8, 6> &CRC_6_ITU();
  static const Parameters<crcpp_uint8, 7> &CRC_7();
#endif
  static const Parameters<crcpp_uint8, 8> &CRC_8();
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint8, 8> &CRC_8_EBU();
  static const Parameters<crcpp_uint8, 8> &CRC_8_MAXIM();
  static const Parameters<crcpp_uint8, 8> &CRC_8_WCDMA();
  static const Parameters<crcpp_uint16, 10> &CRC_10();
  static const Parameters<crcpp_uint16, 10> &CRC_10_CDMA2000();
  static const Parameters<crcpp_uint16, 11> &CRC_11();
  static const Parameters<crcpp_uint16, 12> &CRC_12_CDMA2000();
  static const Parameters<crcpp_uint16, 12> &CRC_12_DECT();
  static const Parameters<crcpp_uint16, 12> &CRC_12_UMTS();
  static const Parameters<crcpp_uint16, 13> &CRC_13_BBC();
  static const Parameters<crcpp_uint16, 15> &CRC_15();
  static const Parameters<crcpp_uint16, 15> &CRC_15_MPT1327();
#endif
  static const Parameters<crcpp_uint16, 16> &CRC_16_ARC();
  static const Parameters<crcpp_uint16, 16> &CRC_16_BUYPASS();
  static const Parameters<crcpp_uint16, 16> &CRC_16_CCITTFALSE();
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint16, 16> &CRC_16_CDMA2000();
  static const Parameters<crcpp_uint16, 16> &CRC_16_DECTR();
  static const Parameters<crcpp_uint16, 16> &CRC_16_DECTX();
  static const Parameters<crcpp_uint16, 16> &CRC_16_DNP();
#endif
  static const Parameters<crcpp_uint16, 16> &CRC_16_GENIBUS();
  static const Parameters<crcpp_uint16, 16> &CRC_16_KERMIT();
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint16, 16> &CRC_16_MAXIM();
  static const Parameters<crcpp_uint16, 16> &CRC_16_MODBUS();
  static const Parameters<crcpp_uint16, 16> &CRC_16_T10DIF();
  static const Parameters<crcpp_uint16, 16> &CRC_16_USB();
#endif
  static const Parameters<crcpp_uint16, 16> &CRC_16_X25();
  static const Parameters<crcpp_uint16, 16> &CRC_16_XMODEM();
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint32, 17> &CRC_17_CAN();
  static const Parameters<crcpp_uint32, 21> &CRC_21_CAN();
  static const Parameters<crcpp_uint32, 24> &CRC_24();
  static const Parameters<crcpp_uint32, 24> &CRC_24_FLEXRAYA();
  static const Parameters<crcpp_uint32, 24> &CRC_24_FLEXRAYB();
  static const Parameters<crcpp_uint32, 30> &CRC_30();
#endif
  static const Parameters<crcpp_uint32, 32> &CRC_32();
  static const Parameters<crcpp_uint32, 32> &CRC_32_BZIP2();
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint32, 32> &CRC_32_C();
#endif
  static const Parameters<crcpp_uint32, 32> &CRC_32_MPEG2();
  static const Parameters<crcpp_uint32, 32> &CRC_32_POSIX();
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
  static const Parameters<crcpp_uint32, 32> &CRC_32_Q();
  static const Parameters<crcpp_uint64, 40> &CRC_40_GSM();
  static const Parameters<crcpp_uint64, 64> &CRC_64();
#endif

#ifdef CRCPP_USE_CPP11
  CRC() = delete;
  CRC(const CRC &other) = delete;
  CRC &operator=(const CRC &other) = delete;
  CRC(CRC &&other) = delete;
  CRC &operator=(CRC &&other) = delete;
#endif

private:
#ifndef CRCPP_USE_CPP11
  CRC();
  CRC(const CRC &other);
  CRC &operator=(const CRC &other);
#endif

  template <typename IntegerType>
  static IntegerType Reflect(IntegerType value, crcpp_uint16 numBits);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType Finalize(CRCType remainder,
                          CRCType finalXOR,
                          bool reflectOutput);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType UndoFinalize(CRCType remainder,
                              CRCType finalXOR,
                              bool reflectOutput);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType CalculateRemainder(
      const void *data,
      crcpp_size size,
      const Parameters<CRCType, CRCWidth> &parameters,
      CRCType remainder);

  template <typename CRCType, crcpp_uint16 CRCWidth>
  static CRCType CalculateRemainder(const void *data,
                                    crcpp_size size,
                                    const Table<CRCType, CRCWidth> &lookupTable,
                                    CRCType remainder);

  template <typename IntegerType>
  static crcpp_constexpr IntegerType BoundedConstexprValue(IntegerType x);
};

/**
    @brief Returns a CRC lookup table construct using these CRC parameters.
    @note This function primarily exists to allow use of the auto keyword
   instead of instantiating
        a table directly, since template parameters are not inferred in
   constructors.
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC lookup table
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRC::Table<CRCType, CRCWidth>
CRC::Parameters<CRCType, CRCWidth>::MakeTable() const {
  // This should take advantage of RVO and optimize out the copy.
  return CRC::Table<CRCType, CRCWidth>(*this);
}

/**
    @brief Constructs a CRC table from a set of CRC parameters
    @param[in] parameters CRC parameters
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRC::Table<CRCType, CRCWidth>::Table(
    const Parameters<CRCType, CRCWidth> &parameters)
    : parameters(parameters) {
  InitTable();
}

#ifdef CRCPP_USE_CPP11
/**
    @brief Constructs a CRC table from a set of CRC parameters
    @param[in] parameters CRC parameters
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRC::Table<CRCType, CRCWidth>::Table(
    Parameters<CRCType, CRCWidth> &&parameters)
    : parameters(::std::move(parameters)) {
  InitTable();
}
#endif

/**
    @brief Gets the CRC parameters used to construct the CRC table
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC parameters
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline const CRC::Parameters<CRCType, CRCWidth>
    &CRC::Table<CRCType, CRCWidth>::GetParameters() const {
  return parameters;
}

/**
    @brief Gets the CRC table
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC table
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline const CRCType *CRC::Table<CRCType, CRCWidth>::GetTable() const {
  return table;
}

/**
    @brief Gets an entry in the CRC table
    @param[in] index Index into the CRC table
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC table entry
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::Table<CRCType, CRCWidth>::operator[](
    unsigned char index) const {
  return table[index];
}

/**
    @brief Initializes a CRC table.
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline void CRC::Table<CRCType, CRCWidth>::InitTable() {
  // For masking off the bits for the CRC (in the event that the number of bits
  // in CRCType is larger than CRCWidth)
  static crcpp_constexpr CRCType BIT_MASK(
      (CRCType(1) << (CRCWidth - CRCType(1))) |
      ((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1)));

  static crcpp_constexpr CRCType SHIFT(
      CRC::BoundedConstexprValue(CHAR_BIT - CRCWidth));

  CRCType crc;
  unsigned char byte = 0;

  // Loop over each dividend (each possible number storable in an unsigned char)
  do {
    crc = CRC::CalculateRemainder<CRCType, CRCWidth>(
        &byte, sizeof(byte), parameters, CRCType(0));

    // This mask might not be necessary; all unit tests pass with this line
    // commented out,
    // but that might just be a coincidence based on the CRC parameters used for
    // testing.
    // In any case, this is harmless to leave in and only adds a single machine
    // instruction per loop iteration.
    crc &= BIT_MASK;

    if (!parameters.reflectInput && CRCWidth < CHAR_BIT) {
      // Undo the special operation at the end of the CalculateRemainder()
      // function for non-reflected CRCs < CHAR_BIT.
      crc <<= SHIFT;
    }

    table[byte] = crc;
  } while (++byte);
}

/**
    @brief Computes a CRC.
    @param[in] data Data over which CRC will be computed
    @param[in] size Size of the data
    @param[in] parameters CRC parameters
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::Calculate(const void *data,
                              crcpp_size size,
                              const Parameters<CRCType, CRCWidth> &parameters) {
  CRCType remainder =
      CalculateRemainder(data, size, parameters, parameters.initialValue);

  // No need to mask the remainder here; the mask will be applied in the
  // Finalize() function.

  return Finalize<CRCType, CRCWidth>(
      remainder,
      parameters.finalXOR,
      parameters.reflectInput != parameters.reflectOutput);
}
/**
    @brief Appends additional data to a previous CRC calculation.
    @note This function can be used to compute multi-part CRCs.
    @param[in] data Data over which CRC will be computed
    @param[in] size Size of the data
    @param[in] parameters CRC parameters
    @param[in] crc CRC from a previous calculation
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::Calculate(const void *data,
                              crcpp_size size,
                              const Parameters<CRCType, CRCWidth> &parameters,
                              CRCType crc) {
  CRCType remainder = UndoFinalize<CRCType, CRCWidth>(
      crc,
      parameters.finalXOR,
      parameters.reflectInput != parameters.reflectOutput);

  remainder = CalculateRemainder(data, size, parameters, remainder);

  // No need to mask the remainder here; the mask will be applied in the
  // Finalize() function.

  return Finalize<CRCType, CRCWidth>(
      remainder,
      parameters.finalXOR,
      parameters.reflectInput != parameters.reflectOutput);
}

/**
    @brief Computes a CRC via a lookup table.
    @param[in] data Data over which CRC will be computed
    @param[in] size Size of the data
    @param[in] lookupTable CRC lookup table
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::Calculate(const void *data,
                              crcpp_size size,
                              const Table<CRCType, CRCWidth> &lookupTable) {
  const Parameters<CRCType, CRCWidth> &parameters = lookupTable.GetParameters();

  CRCType remainder =
      CalculateRemainder(data, size, lookupTable, parameters.initialValue);

  // No need to mask the remainder here; the mask will be applied in the
  // Finalize() function.

  return Finalize<CRCType, CRCWidth>(
      remainder,
      parameters.finalXOR,
      parameters.reflectInput != parameters.reflectOutput);
}

/**
    @brief Appends additional data to a previous CRC calculation using a lookup
   table.
    @note This function can be used to compute multi-part CRCs.
    @param[in] data Data over which CRC will be computed
    @param[in] size Size of the data
    @param[in] lookupTable CRC lookup table
    @param[in] crc CRC from a previous calculation
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::Calculate(const void *data,
                              crcpp_size size,
                              const Table<CRCType, CRCWidth> &lookupTable,
                              CRCType crc) {
  const Parameters<CRCType, CRCWidth> &parameters = lookupTable.GetParameters();

  CRCType remainder = UndoFinalize<CRCType, CRCWidth>(
      crc,
      parameters.finalXOR,
      parameters.reflectInput != parameters.reflectOutput);

  remainder = CalculateRemainder(data, size, lookupTable, remainder);

  // No need to mask the remainder here; the mask will be applied in the
  // Finalize() function.

  return Finalize<CRCType, CRCWidth>(
      remainder,
      parameters.finalXOR,
      parameters.reflectInput != parameters.reflectOutput);
}

/**
    @brief Reflects (i.e. reverses the bits within) an integer value.
    @param[in] value Value to reflect
    @param[in] numBits Number of bits in the integer which will be reflected
    @tparam IntegerType Integer type of the value being reflected
    @return Reflected value
*/
template <typename IntegerType>
inline IntegerType CRC::Reflect(IntegerType value, crcpp_uint16 numBits) {
  IntegerType reversedValue(0);

  for (crcpp_uint16 i = 0; i < numBits; ++i) {
    reversedValue = (reversedValue << 1) | (value & 1);
    value >>= 1;
  }

  return reversedValue;
}

/**
    @brief Computes the final reflection and XOR of a CRC remainder.
    @param[in] remainder CRC remainder to reflect and XOR
    @param[in] finalXOR Final value to XOR with the remainder
    @param[in] reflectOutput true to reflect each byte of the remainder before
   the XOR
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return Final CRC
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::Finalize(CRCType remainder,
                             CRCType finalXOR,
                             bool reflectOutput) {
  // For masking off the bits for the CRC (in the event that the number of bits
  // in CRCType is larger than CRCWidth)
  static crcpp_constexpr CRCType BIT_MASK =
      (CRCType(1) << (CRCWidth - CRCType(1))) |
      ((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1));

  if (reflectOutput) {
    remainder = Reflect(remainder, CRCWidth);
  }

  return (remainder ^ finalXOR) & BIT_MASK;
}

/**
    @brief Undoes the process of computing the final reflection and XOR of a CRC
   remainder.
    @note This function allows for computation of multi-part CRCs
    @note Calling UndoFinalize() followed by Finalize() (or vice versa) will
   always return the original remainder value:

        CRCType x = ...;
        CRCType y = Finalize(x, finalXOR, reflectOutput);
        CRCType z = UndoFinalize(y, finalXOR, reflectOutput);
        assert(x == z);

    @param[in] crc Reflected and XORed CRC
    @param[in] finalXOR Final value XORed with the remainder
    @param[in] reflectOutput true if the remainder is to be reflected
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return Un-finalized CRC remainder
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::UndoFinalize(CRCType crc,
                                 CRCType finalXOR,
                                 bool reflectOutput) {
  // For masking off the bits for the CRC (in the event that the number of bits
  // in CRCType is larger than CRCWidth)
  static crcpp_constexpr CRCType BIT_MASK =
      (CRCType(1) << (CRCWidth - CRCType(1))) |
      ((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1));

  crc = (crc & BIT_MASK) ^ finalXOR;

  if (reflectOutput) {
    crc = Reflect(crc, CRCWidth);
  }

  return crc;
}

/**
    @brief Computes a CRC remainder.
    @param[in] data Data over which the remainder will be computed
    @param[in] size Size of the data
    @param[in] parameters CRC parameters
    @param[in] remainder Running CRC remainder. Can be an initial value or the
   result of a previous CRC remainder calculation.
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC remainder
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::CalculateRemainder(
    const void *data,
    crcpp_size size,
    const Parameters<CRCType, CRCWidth> &parameters,
    CRCType remainder) {
#ifdef CRCPP_USE_CPP11
  // This static_assert is put here because this function will always be
  // compiled in no matter what
  // the template parameters are and whether or not a table lookup or bit-by-bit
  // algorithm is used.
  static_assert(::std::numeric_limits<CRCType>::digits >= CRCWidth,
                "CRCType is too small to contain a CRC of width CRCWidth.");
#else
  // Catching this compile-time error is very important. Sadly, the compiler
  // error will be very cryptic, but it's
  // better than nothing.
  enum {
    static_assert_failed_CRCType_is_too_small_to_contain_a_CRC_of_width_CRCWidth =
        1 / (::std::numeric_limits<CRCType>::digits >= CRCWidth ? 1 : 0)
  };
#endif

  const unsigned char *current = reinterpret_cast<const unsigned char *>(data);

  // Slightly different implementations based on the parameters. The current
  // implementations try to eliminate as much
  // computation from the inner loop (looping over each bit) as possible.
  if (parameters.reflectInput) {
    CRCType polynomial = CRC::Reflect(parameters.polynomial, CRCWidth);
    while (size--) {
      remainder ^= *current++;

      // An optimizing compiler might choose to unroll this loop.
      for (crcpp_size i = 0; i < CHAR_BIT; ++i) {
#ifdef CRCPP_BRANCHLESS
        // Clever way to avoid a branch at the expense of a multiplication. This
        // code is equivalent to the following:
        // if (remainder & 1)
        //     remainder = (remainder >> 1) ^ polynomial;
        // else
        //     remainder >>= 1;
        remainder = (remainder >> 1) ^ ((remainder & 1) * polynomial);
#else
        remainder = (remainder & 1) ? ((remainder >> 1) ^ polynomial)
                                    : (remainder >> 1);
#endif
      }
    }
  } else if (CRCWidth >= CHAR_BIT) {
    static crcpp_constexpr CRCType CRC_WIDTH_MINUS_ONE(CRCWidth - CRCType(1));
#ifndef CRCPP_BRANCHLESS
    static crcpp_constexpr CRCType CRC_HIGHEST_BIT_MASK(CRCType(1)
                                                        << CRC_WIDTH_MINUS_ONE);
#endif
    static crcpp_constexpr CRCType SHIFT(
        BoundedConstexprValue(CRCWidth - CHAR_BIT));

    while (size--) {
      remainder ^= (static_cast<CRCType>(*current++) << SHIFT);

      // An optimizing compiler might choose to unroll this loop.
      for (crcpp_size i = 0; i < CHAR_BIT; ++i) {
#ifdef CRCPP_BRANCHLESS
        // Clever way to avoid a branch at the expense of a multiplication. This
        // code is equivalent to the following:
        // if (remainder & CRC_HIGHEST_BIT_MASK)
        //     remainder = (remainder << 1) ^ parameters.polynomial;
        // else
        //     remainder <<= 1;
        remainder =
            (remainder << 1) ^
            (((remainder >> CRC_WIDTH_MINUS_ONE) & 1) * parameters.polynomial);
#else
        remainder = (remainder & CRC_HIGHEST_BIT_MASK)
                        ? ((remainder << 1) ^ parameters.polynomial)
                        : (remainder << 1);
#endif
      }
    }
  } else {
    static crcpp_constexpr CRCType CHAR_BIT_MINUS_ONE(CHAR_BIT - 1);
#ifndef CRCPP_BRANCHLESS
    static crcpp_constexpr CRCType CHAR_BIT_HIGHEST_BIT_MASK(
        CRCType(1) << CHAR_BIT_MINUS_ONE);
#endif
    static crcpp_constexpr CRCType SHIFT(
        BoundedConstexprValue(CHAR_BIT - CRCWidth));

    CRCType polynomial = parameters.polynomial << SHIFT;
    remainder <<= SHIFT;

    while (size--) {
      remainder ^= *current++;

      // An optimizing compiler might choose to unroll this loop.
      for (crcpp_size i = 0; i < CHAR_BIT; ++i) {
#ifdef CRCPP_BRANCHLESS
        // Clever way to avoid a branch at the expense of a multiplication. This
        // code is equivalent to the following:
        // if (remainder & CHAR_BIT_HIGHEST_BIT_MASK)
        //     remainder = (remainder << 1) ^ polynomial;
        // else
        //     remainder <<= 1;
        remainder = (remainder << 1) ^
                    (((remainder >> CHAR_BIT_MINUS_ONE) & 1) * polynomial);
#else
        remainder = (remainder & CHAR_BIT_HIGHEST_BIT_MASK)
                        ? ((remainder << 1) ^ polynomial)
                        : (remainder << 1);
#endif
      }
    }

    remainder >>= SHIFT;
  }

  return remainder;
}

/**
    @brief Computes a CRC remainder using lookup table.
    @param[in] data Data over which the remainder will be computed
    @param[in] size Size of the data
    @param[in] lookupTable CRC lookup table
    @param[in] remainder Running CRC remainder. Can be an initial value or the
   result of a previous CRC remainder calculation.
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return CRC remainder
*/
template <typename CRCType, crcpp_uint16 CRCWidth>
inline CRCType CRC::CalculateRemainder(
    const void *data,
    crcpp_size size,
    const Table<CRCType, CRCWidth> &lookupTable,
    CRCType remainder) {
  const unsigned char *current = reinterpret_cast<const unsigned char *>(data);

  if (lookupTable.GetParameters().reflectInput) {
    while (size--) {
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
// remainder is one byte long. The algorithm is still correct in this case,
// though it's possible that one additional machine instruction will be
// executed.
#pragma warning(push)
#pragma warning(disable : 4333)
#endif
      remainder =
          (remainder >> CHAR_BIT) ^
          lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
#pragma warning(pop)
#endif
    }
  } else if (CRCWidth >= CHAR_BIT) {
    static crcpp_constexpr CRCType SHIFT(
        BoundedConstexprValue(CRCWidth - CHAR_BIT));

    while (size--) {
      remainder = (remainder << CHAR_BIT) ^
                  lookupTable[static_cast<unsigned char>((remainder >> SHIFT) ^
                                                         *current++)];
    }
  } else {
    static crcpp_constexpr CRCType SHIFT(
        BoundedConstexprValue(CHAR_BIT - CRCWidth));

    remainder <<= SHIFT;

    while (size--) {
      // Note: no need to mask here since remainder is guaranteed to fit in a
      // single byte.
      remainder =
          lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
    }

    remainder >>= SHIFT;
  }

  return remainder;
}

/**
    @brief Function to force a compile-time expression to be >= 0.
    @note This function is used to avoid compiler warnings because all constexpr
   values are evaluated
        in a function even in a branch will never be executed. This also means
   we don't need pragmas
        to get rid of warnings, but it still can be computed at compile-time.
   Win-win!
    @param[in] x Compile-time expression to bound
    @tparam CRCType Integer type for storing the CRC result
    @tparam CRCWidth Number of bits in the CRC
    @return Non-negative compile-time expression
*/
template <typename IntegerType>
inline crcpp_constexpr IntegerType CRC::BoundedConstexprValue(IntegerType x) {
  return (x < IntegerType(0)) ? IntegerType(0) : x;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-4 ITU.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-4 ITU has the following parameters and check value:
        - polynomial     = 0x3
        - initial value  = 0x0
        - final XOR      = 0x0
        - reflect input  = true
        - reflect output = true
        - check value    = 0x7
    @return CRC-4 ITU parameters
*/
inline const CRC::Parameters<crcpp_uint8, 4> &CRC::CRC_4_ITU() {
  static const Parameters<crcpp_uint8, 4> parameters = {
      0x3, 0x0, 0x0, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-5 EPC.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-5 EPC has the following parameters and check value:
        - polynomial     = 0x09
        - initial value  = 0x09
        - final XOR      = 0x00
        - reflect input  = false
        - reflect output = false
        - check value    = 0x00
    @return CRC-5 EPC parameters
*/
inline const CRC::Parameters<crcpp_uint8, 5> &CRC::CRC_5_EPC() {
  static const Parameters<crcpp_uint8, 5> parameters = {
      0x09, 0x09, 0x00, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-5 ITU.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-5 ITU has the following parameters and check value:
        - polynomial     = 0x15
        - initial value  = 0x00
        - final XOR      = 0x00
        - reflect input  = true
        - reflect output = true
        - check value    = 0x07
    @return CRC-5 ITU parameters
*/
inline const CRC::Parameters<crcpp_uint8, 5> &CRC::CRC_5_ITU() {
  static const Parameters<crcpp_uint8, 5> parameters = {
      0x15, 0x00, 0x00, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-5 USB.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-5 USB has the following parameters and check value:
        - polynomial     = 0x05
        - initial value  = 0x1F
        - final XOR      = 0x1F
        - reflect input  = true
        - reflect output = true
        - check value    = 0x19
    @return CRC-5 USB parameters
*/
inline const CRC::Parameters<crcpp_uint8, 5> &CRC::CRC_5_USB() {
  static const Parameters<crcpp_uint8, 5> parameters = {
      0x05, 0x1F, 0x1F, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-6 CDMA2000-A.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-6 CDMA2000-A has the following parameters and check value:
        - polynomial     = 0x27
        - initial value  = 0x3F
        - final XOR      = 0x00
        - reflect input  = false
        - reflect output = false
        - check value    = 0x0D
    @return CRC-6 CDMA2000-A parameters
*/
inline const CRC::Parameters<crcpp_uint8, 6> &CRC::CRC_6_CDMA2000A() {
  static const Parameters<crcpp_uint8, 6> parameters = {
      0x27, 0x3F, 0x00, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-6 CDMA2000-B.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-6 CDMA2000-A has the following parameters and check value:
        - polynomial     = 0x07
        - initial value  = 0x3F
        - final XOR      = 0x00
        - reflect input  = false
        - reflect output = false
        - check value    = 0x3B
    @return CRC-6 CDMA2000-B parameters
*/
inline const CRC::Parameters<crcpp_uint8, 6> &CRC::CRC_6_CDMA2000B() {
  static const Parameters<crcpp_uint8, 6> parameters = {
      0x07, 0x3F, 0x00, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-6 ITU.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-6 ITU has the following parameters and check value:
        - polynomial     = 0x03
        - initial value  = 0x00
        - final XOR      = 0x00
        - reflect input  = true
        - reflect output = true
        - check value    = 0x06
    @return CRC-6 ITU parameters
*/
inline const CRC::Parameters<crcpp_uint8, 6> &CRC::CRC_6_ITU() {
  static const Parameters<crcpp_uint8, 6> parameters = {
      0x03, 0x00, 0x00, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-7 JEDEC.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-7 JEDEC has the following parameters and check value:
        - polynomial     = 0x09
        - initial value  = 0x00
        - final XOR      = 0x00
        - reflect input  = false
        - reflect output = false
        - check value    = 0x75
    @return CRC-7 JEDEC parameters
*/
inline const CRC::Parameters<crcpp_uint8, 7> &CRC::CRC_7() {
  static const Parameters<crcpp_uint8, 7> parameters = {
      0x09, 0x00, 0x00, false, false};
  return parameters;
}
#endif  // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

/**
    @brief Returns a set of parameters for CRC-8 SMBus.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-8 SMBus has the following parameters and check value:
        - polynomial     = 0x07
        - initial value  = 0x00
        - final XOR      = 0x00
        - reflect input  = false
        - reflect output = false
        - check value    = 0xF4
    @return CRC-8 SMBus parameters
*/
inline const CRC::Parameters<crcpp_uint8, 8> &CRC::CRC_8() {
  static const Parameters<crcpp_uint8, 8> parameters = {
      0x07, 0x00, 0x00, false, false};
  return parameters;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-8 EBU (aka CRC-8 AES).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-8 EBU has the following parameters and check value:
        - polynomial     = 0x1D
        - initial value  = 0xFF
        - final XOR      = 0x00
        - reflect input  = true
        - reflect output = true
        - check value    = 0x97
    @return CRC-8 EBU parameters
*/
inline const CRC::Parameters<crcpp_uint8, 8> &CRC::CRC_8_EBU() {
  static const Parameters<crcpp_uint8, 8> parameters = {
      0x1D, 0xFF, 0x00, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-8 MAXIM (aka CRC-8 DOW-CRC).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-8 MAXIM has the following parameters and check value:
        - polynomial     = 0x31
        - initial value  = 0x00
        - final XOR      = 0x00
        - reflect input  = true
        - reflect output = true
        - check value    = 0xA1
    @return CRC-8 MAXIM parameters
*/
inline const CRC::Parameters<crcpp_uint8, 8> &CRC::CRC_8_MAXIM() {
  static const Parameters<crcpp_uint8, 8> parameters = {
      0x31, 0x00, 0x00, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-8 WCDMA.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-8 WCDMA has the following parameters and check value:
        - polynomial     = 0x9B
        - initial value  = 0x00
        - final XOR      = 0x00
        - reflect input  = true
        - reflect output = true
        - check value    = 0x25
    @return CRC-8 WCDMA parameters
*/
inline const CRC::Parameters<crcpp_uint8, 8> &CRC::CRC_8_WCDMA() {
  static const Parameters<crcpp_uint8, 8> parameters = {
      0x9B, 0x00, 0x00, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-10 ITU.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-10 ITU has the following parameters and check value:
        - polynomial     = 0x233
        - initial value  = 0x000
        - final XOR      = 0x000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x199
    @return CRC-10 ITU parameters
*/
inline const CRC::Parameters<crcpp_uint16, 10> &CRC::CRC_10() {
  static const Parameters<crcpp_uint16, 10> parameters = {
      0x233, 0x000, 0x000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-10 CDMA2000.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-10 CDMA2000 has the following parameters and check value:
        - polynomial     = 0x3D9
        - initial value  = 0x3FF
        - final XOR      = 0x000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x233
    @return CRC-10 CDMA2000 parameters
*/
inline const CRC::Parameters<crcpp_uint16, 10> &CRC::CRC_10_CDMA2000() {
  static const Parameters<crcpp_uint16, 10> parameters = {
      0x3D9, 0x3FF, 0x000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-11 FlexRay.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-11 FlexRay has the following parameters and check value:
        - polynomial     = 0x385
        - initial value  = 0x01A
        - final XOR      = 0x000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x5A3
    @return CRC-11 FlexRay parameters
*/
inline const CRC::Parameters<crcpp_uint16, 11> &CRC::CRC_11() {
  static const Parameters<crcpp_uint16, 11> parameters = {
      0x385, 0x01A, 0x000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-12 CDMA2000.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-12 CDMA2000 has the following parameters and check value:
        - polynomial     = 0xF13
        - initial value  = 0xFFF
        - final XOR      = 0x000
        - reflect input  = false
        - reflect output = false
        - check value    = 0xD4D
    @return CRC-12 CDMA2000 parameters
*/
inline const CRC::Parameters<crcpp_uint16, 12> &CRC::CRC_12_CDMA2000() {
  static const Parameters<crcpp_uint16, 12> parameters = {
      0xF13, 0xFFF, 0x000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-12 DECT (aka CRC-12 X-CRC).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-12 DECT has the following parameters and check value:
        - polynomial     = 0x80F
        - initial value  = 0x000
        - final XOR      = 0x000
        - reflect input  = false
        - reflect output = false
        - check value    = 0xF5B
    @return CRC-12 DECT parameters
*/
inline const CRC::Parameters<crcpp_uint16, 12> &CRC::CRC_12_DECT() {
  static const Parameters<crcpp_uint16, 12> parameters = {
      0x80F, 0x000, 0x000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-12 UMTS (aka CRC-12 3GPP).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-12 UMTS has the following parameters and check value:
        - polynomial     = 0x80F
        - initial value  = 0x000
        - final XOR      = 0x000
        - reflect input  = false
        - reflect output = true
        - check value    = 0xDAF
    @return CRC-12 UMTS parameters
*/
inline const CRC::Parameters<crcpp_uint16, 12> &CRC::CRC_12_UMTS() {
  static const Parameters<crcpp_uint16, 12> parameters = {
      0x80F, 0x000, 0x000, false, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-13 BBC.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-13 BBC has the following parameters and check value:
        - polynomial     = 0x1CF5
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x04FA
    @return CRC-13 BBC parameters
*/
inline const CRC::Parameters<crcpp_uint16, 13> &CRC::CRC_13_BBC() {
  static const Parameters<crcpp_uint16, 13> parameters = {
      0x1CF5, 0x0000, 0x0000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-15 CAN.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-15 CAN has the following parameters and check value:
        - polynomial     = 0x4599
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x059E
    @return CRC-15 CAN parameters
*/
inline const CRC::Parameters<crcpp_uint16, 15> &CRC::CRC_15() {
  static const Parameters<crcpp_uint16, 15> parameters = {
      0x4599, 0x0000, 0x0000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-15 MPT1327.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-15 MPT1327 has the following parameters and check value:
        - polynomial     = 0x6815
        - initial value  = 0x0000
        - final XOR      = 0x0001
        - reflect input  = false
        - reflect output = false
        - check value    = 0x2566
    @return CRC-15 MPT1327 parameters
*/
inline const CRC::Parameters<crcpp_uint16, 15> &CRC::CRC_15_MPT1327() {
  static const Parameters<crcpp_uint16, 15> parameters = {
      0x6815, 0x0000, 0x0001, false, false};
  return parameters;
}
#endif  // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

/**
    @brief Returns a set of parameters for CRC-16 ARC (aka CRC-16 IBM, CRC-16
   LHA).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 ARC has the following parameters and check value:
        - polynomial     = 0x8005
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = true
        - reflect output = true
        - check value    = 0xBB3D
    @return CRC-16 ARC parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_ARC() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x8005, 0x0000, 0x0000, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 BUYPASS (aka CRC-16 VERIFONE,
   CRC-16 UMTS).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 BUYPASS has the following parameters and check value:
        - polynomial     = 0x8005
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0xFEE8
    @return CRC-16 BUYPASS parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_BUYPASS() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x8005, 0x0000, 0x0000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 CCITT FALSE.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 CCITT FALSE has the following parameters and check value:
        - polynomial     = 0x1021
        - initial value  = 0xFFFF
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x29B1
    @return CRC-16 CCITT FALSE parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_CCITTFALSE() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x1021, 0xFFFF, 0x0000, false, false};
  return parameters;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-16 CDMA2000.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 CDMA2000 has the following parameters and check value:
        - polynomial     = 0xC867
        - initial value  = 0xFFFF
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x4C06
    @return CRC-16 CDMA2000 parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_CDMA2000() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0xC867, 0xFFFF, 0x0000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 DECT-R (aka CRC-16 R-CRC).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 DECT-R has the following parameters and check value:
        - polynomial     = 0x0589
        - initial value  = 0x0000
        - final XOR      = 0x0001
        - reflect input  = false
        - reflect output = false
        - check value    = 0x007E
    @return CRC-16 DECT-R parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_DECTR() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x0589, 0x0000, 0x0001, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 DECT-X (aka CRC-16 X-CRC).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 DECT-X has the following parameters and check value:
        - polynomial     = 0x0589
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x007F
    @return CRC-16 DECT-X parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_DECTX() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x0589, 0x0000, 0x0000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 DNP.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 DNP has the following parameters and check value:
        - polynomial     = 0x3D65
        - initial value  = 0x0000
        - final XOR      = 0xFFFF
        - reflect input  = true
        - reflect output = true
        - check value    = 0xEA82
    @return CRC-16 DNP parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_DNP() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x3D65, 0x0000, 0xFFFF, true, true};
  return parameters;
}
#endif  // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

/**
    @brief Returns a set of parameters for CRC-16 GENIBUS (aka CRC-16 EPC,
   CRC-16 I-CODE, CRC-16 DARC).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 GENIBUS has the following parameters and check value:
        - polynomial     = 0x1021
        - initial value  = 0xFFFF
        - final XOR      = 0xFFFF
        - reflect input  = false
        - reflect output = false
        - check value    = 0xD64E
    @return CRC-16 GENIBUS parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_GENIBUS() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x1021, 0xFFFF, 0xFFFF, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 KERMIT (aka CRC-16 CCITT,
   CRC-16 CCITT-TRUE).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 KERMIT has the following parameters and check value:
        - polynomial     = 0x1021
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = true
        - reflect output = true
        - check value    = 0x2189
    @return CRC-16 KERMIT parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_KERMIT() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x1021, 0x0000, 0x0000, true, true};
  return parameters;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-16 MAXIM.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 MAXIM has the following parameters and check value:
        - polynomial     = 0x8005
        - initial value  = 0x0000
        - final XOR      = 0xFFFF
        - reflect input  = true
        - reflect output = true
        - check value    = 0x44C2
    @return CRC-16 MAXIM parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_MAXIM() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x8005, 0x0000, 0xFFFF, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 MODBUS.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 MODBUS has the following parameters and check value:
        - polynomial     = 0x8005
        - initial value  = 0xFFFF
        - final XOR      = 0x0000
        - reflect input  = true
        - reflect output = true
        - check value    = 0x4B37
    @return CRC-16 MODBUS parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_MODBUS() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x8005, 0xFFFF, 0x0000, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 T10-DIF.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 T10-DIF has the following parameters and check value:
        - polynomial     = 0x8BB7
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0xD0DB
    @return CRC-16 T10-DIF parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_T10DIF() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x8BB7, 0x0000, 0x0000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 USB.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 USB has the following parameters and check value:
        - polynomial     = 0x8005
        - initial value  = 0xFFFF
        - final XOR      = 0xFFFF
        - reflect input  = true
        - reflect output = true
        - check value    = 0xB4C8
    @return CRC-16 USB parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_USB() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x8005, 0xFFFF, 0xFFFF, true, true};
  return parameters;
}
#endif  // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

/**
    @brief Returns a set of parameters for CRC-16 X-25 (aka CRC-16 IBM-SDLC,
   CRC-16 ISO-HDLC, CRC-16 B).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 X-25 has the following parameters and check value:
        - polynomial     = 0x1021
        - initial value  = 0xFFFF
        - final XOR      = 0xFFFF
        - reflect input  = true
        - reflect output = true
        - check value    = 0x906E
    @return CRC-16 X-25 parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_X25() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x1021, 0xFFFF, 0xFFFF, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-16 XMODEM (aka CRC-16 ZMODEM,
   CRC-16 ACORN, CRC-16 LTE).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-16 XMODEM has the following parameters and check value:
        - polynomial     = 0x1021
        - initial value  = 0x0000
        - final XOR      = 0x0000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x31C3
    @return CRC-16 XMODEM parameters
*/
inline const CRC::Parameters<crcpp_uint16, 16> &CRC::CRC_16_XMODEM() {
  static const Parameters<crcpp_uint16, 16> parameters = {
      0x1021, 0x0000, 0x0000, false, false};
  return parameters;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-17 CAN.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-17 CAN has the following parameters and check value:
        - polynomial     = 0x1685B
        - initial value  = 0x00000
        - final XOR      = 0x00000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x04F03
    @return CRC-17 CAN parameters
*/
inline const CRC::Parameters<crcpp_uint32, 17> &CRC::CRC_17_CAN() {
  static const Parameters<crcpp_uint32, 17> parameters = {
      0x1685B, 0x00000, 0x00000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-21 CAN.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-21 CAN has the following parameters and check value:
        - polynomial     = 0x102899
        - initial value  = 0x000000
        - final XOR      = 0x000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x0ED841
    @return CRC-21 CAN parameters
*/
inline const CRC::Parameters<crcpp_uint32, 21> &CRC::CRC_21_CAN() {
  static const Parameters<crcpp_uint32, 21> parameters = {
      0x102899, 0x000000, 0x000000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-24 OPENPGP.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-24 OPENPGP has the following parameters and check value:
        - polynomial     = 0x864CFB
        - initial value  = 0xB704CE
        - final XOR      = 0x000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x21CF02
    @return CRC-24 OPENPGP parameters
*/
inline const CRC::Parameters<crcpp_uint32, 24> &CRC::CRC_24() {
  static const Parameters<crcpp_uint32, 24> parameters = {
      0x864CFB, 0xB704CE, 0x000000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-24 FlexRay-A.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-24 FlexRay-A has the following parameters and check value:
        - polynomial     = 0x5D6DCB
        - initial value  = 0xFEDCBA
        - final XOR      = 0x000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x7979BD
    @return CRC-24 FlexRay-A parameters
*/
inline const CRC::Parameters<crcpp_uint32, 24> &CRC::CRC_24_FLEXRAYA() {
  static const Parameters<crcpp_uint32, 24> parameters = {
      0x5D6DCB, 0xFEDCBA, 0x000000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-24 FlexRay-B.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-24 FlexRay-B has the following parameters and check value:
        - polynomial     = 0x5D6DCB
        - initial value  = 0xABCDEF
        - final XOR      = 0x000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x1F23B8
    @return CRC-24 FlexRay-B parameters
*/
inline const CRC::Parameters<crcpp_uint32, 24> &CRC::CRC_24_FLEXRAYB() {
  static const Parameters<crcpp_uint32, 24> parameters = {
      0x5D6DCB, 0xABCDEF, 0x000000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-30 CDMA.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-30 CDMA has the following parameters and check value:
        - polynomial     = 0x2030B9C7
        - initial value  = 0x3FFFFFFF
        - final XOR      = 0x00000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x3B3CB540
    @return CRC-30 CDMA parameters
*/
inline const CRC::Parameters<crcpp_uint32, 30> &CRC::CRC_30() {
  static const Parameters<crcpp_uint32, 30> parameters = {
      0x2030B9C7, 0x3FFFFFFF, 0x00000000, false, false};
  return parameters;
}
#endif  // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

/**
    @brief Returns a set of parameters for CRC-32 (aka CRC-32 ADCCP, CRC-32
   PKZip).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-32 has the following parameters and check value:
        - polynomial     = 0x04C11DB7
        - initial value  = 0xFFFFFFFF
        - final XOR      = 0xFFFFFFFF
        - reflect input  = true
        - reflect output = true
        - check value    = 0xCBF43926
    @return CRC-32 parameters
*/
inline const CRC::Parameters<crcpp_uint32, 32> &CRC::CRC_32() {
  static const Parameters<crcpp_uint32, 32> parameters = {
      0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-32 BZIP2 (aka CRC-32 AAL5, CRC-32
   DECT-B, CRC-32 B-CRC).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-32 BZIP2 has the following parameters and check value:
        - polynomial     = 0x04C11DB7
        - initial value  = 0xFFFFFFFF
        - final XOR      = 0xFFFFFFFF
        - reflect input  = false
        - reflect output = false
        - check value    = 0xFC891918
    @return CRC-32 BZIP2 parameters
*/
inline const CRC::Parameters<crcpp_uint32, 32> &CRC::CRC_32_BZIP2() {
  static const Parameters<crcpp_uint32, 32> parameters = {
      0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, false, false};
  return parameters;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-32 C (aka CRC-32 ISCSI, CRC-32
   Castagnoli, CRC-32 Interlaken).
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-32 C has the following parameters and check value:
        - polynomial     = 0x1EDC6F41
        - initial value  = 0xFFFFFFFF
        - final XOR      = 0xFFFFFFFF
        - reflect input  = true
        - reflect output = true
        - check value    = 0xE3069283
    @return CRC-32 C parameters
*/
inline const CRC::Parameters<crcpp_uint32, 32> &CRC::CRC_32_C() {
  static const Parameters<crcpp_uint32, 32> parameters = {
      0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true};
  return parameters;
}
#endif

/**
    @brief Returns a set of parameters for CRC-32 MPEG-2.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-32 MPEG-2 has the following parameters and check value:
        - polynomial     = 0x04C11DB7
        - initial value  = 0xFFFFFFFF
        - final XOR      = 0x00000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x0376E6E7
    @return CRC-32 MPEG-2 parameters
*/
inline const CRC::Parameters<crcpp_uint32, 32> &CRC::CRC_32_MPEG2() {
  static const Parameters<crcpp_uint32, 32> parameters = {
      0x04C11DB7, 0xFFFFFFFF, 0x00000000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-32 POSIX.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-32 POSIX has the following parameters and check value:
        - polynomial     = 0x04C11DB7
        - initial value  = 0x00000000
        - final XOR      = 0xFFFFFFFF
        - reflect input  = false
        - reflect output = false
        - check value    = 0x765E7680
    @return CRC-32 POSIX parameters
*/
inline const CRC::Parameters<crcpp_uint32, 32> &CRC::CRC_32_POSIX() {
  static const Parameters<crcpp_uint32, 32> parameters = {
      0x04C11DB7, 0x00000000, 0xFFFFFFFF, false, false};
  return parameters;
}

#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
/**
    @brief Returns a set of parameters for CRC-32 Q.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-32 Q has the following parameters and check value:
        - polynomial     = 0x814141AB
        - initial value  = 0x00000000
        - final XOR      = 0x00000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x3010BF7F
    @return CRC-32 Q parameters
*/
inline const CRC::Parameters<crcpp_uint32, 32> &CRC::CRC_32_Q() {
  static const Parameters<crcpp_uint32, 32> parameters = {
      0x814141AB, 0x00000000, 0x00000000, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-40 GSM.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-40 GSM has the following parameters and check value:
        - polynomial     = 0x0004820009
        - initial value  = 0x0000000000
        - final XOR      = 0xFFFFFFFFFF
        - reflect input  = false
        - reflect output = false
        - check value    = 0xD4164FC646
    @return CRC-40 GSM parameters
*/
inline const CRC::Parameters<crcpp_uint64, 40> &CRC::CRC_40_GSM() {
  static const Parameters<crcpp_uint64, 40> parameters = {
      0x0004820009, 0x0000000000, 0xFFFFFFFFFF, false, false};
  return parameters;
}

/**
    @brief Returns a set of parameters for CRC-64 ECMA.
    @note The parameters are static and are delayed-constructed to reduce memory
   footprint.
    @note CRC-64 ECMA has the following parameters and check value:
        - polynomial     = 0x42F0E1EBA9EA3693
        - initial value  = 0x0000000000000000
        - final XOR      = 0x0000000000000000
        - reflect input  = false
        - reflect output = false
        - check value    = 0x6C40DF5F0B497347
    @return CRC-64 ECMA parameters
*/
inline const CRC::Parameters<crcpp_uint64, 64> &CRC::CRC_64() {
  static const Parameters<crcpp_uint64, 64> parameters = {
      0x42F0E1EBA9EA3693, 0x0000000000000000, 0x0000000000000000, false, false};
  return parameters;
}
#endif  // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS

#ifdef CRCPP_USE_NAMESPACE
}
#endif

#endif  // CRCPP_CRC_H_