@@ -149,7 +149,6 @@ namespace impl
149149 {
150150 using traits = crc_traits<TAccumulator, TABLE_SIZE >;
151151
152-
153152 [[nodiscard]] static constexpr TAccumulator update_impl_tiny (
154153 TAccumulator crc, uint8_t value, typename traits::table_type const &table)
155154 {
@@ -304,7 +303,7 @@ namespace impl
304303 //
305304 // A generic CRC lookup table sized for computing a nibble (4 bits) at a time.
306305 //
307- // This is can be a large reduction of table space storage for embedded devices.
306+ // This is a large reduction of table space storage for embedded devices.
308307 //
309308 template <typename TAccumulator,
310309 TAccumulator const POLYNOMIAL ,
@@ -379,8 +378,6 @@ namespace impl
379378#endif
380379 };
381380
382-
383-
384381 //
385382 // Define the CRC algorithm parameters
386383 //
@@ -479,8 +476,7 @@ namespace alg
479476 using crc16_modbus = impl::crc_algorithm<uint16_t , 0x8005 , 0xFFFF , 0x0000 , true >;
480477 using crc16_x25 = impl::crc_algorithm<uint16_t , 0x1021 , 0xFFFF , 0xFFFF , true >;
481478 using crc16_xmodem = impl::crc_algorithm<uint16_t , 0x1021 , 0x0000 , 0x0000 , false >;
482-
483-
479+ using crc16_m17lsf = impl::crc_algorithm<uint16_t , 0x5935 , 0xFFFF , 0x0000 , false >;
484480
485481 // size, poly, init, xor, reverse
486482 using crc32 = impl::crc_algorithm<uint32_t , 0x04C11DB7 , 0xFFFFFFFF , 0xFFFFFFFF , true >;
@@ -548,6 +544,7 @@ namespace family
548544 template <const table_size TS > class crc16_modbus : public impl ::crc<alg::crc16_modbus, TS >{};
549545 template <const table_size TS > class crc16_x25 : public impl ::crc<alg::crc16_x25, TS >{};
550546 template <const table_size TS > class crc16_xmodem : public impl ::crc<alg::crc16_xmodem, TS >{};
547+ template <const table_size TS > class crc16_m17lsf : public impl ::crc<alg::crc16_m17lsf, TS >{};
551548
552549 template <const table_size TS > class crc32 : public impl ::crc<alg::crc32, TS >{};
553550 template <const table_size TS > class crc32_bzip2 : public impl ::crc<alg::crc32_bzip2, TS >{};
@@ -563,7 +560,9 @@ namespace family
563560
564561} // namespace family
565562
566- namespace small {
563+
564+ // Default implementation "size" selected using inline namespace
565+ inline namespace small {
567566 // ------------------------------------------------------------------------
568567 //
569568 // Define the set of default CRC implementations using small table size
@@ -606,6 +605,7 @@ namespace small {
606605 using crc16_modbus = family::crc16_modbus <table_size::small>;
607606 using crc16_x25 = family::crc16_x25 <table_size::small>;
608607 using crc16_xmodem = family::crc16_xmodem <table_size::small>;
608+ using crc16_m17lsf = family::crc16_m17lsf <table_size::small>;
609609
610610 using crc32 = family::crc32 <table_size::small>;
611611 using crc32_bzip2 = family::crc32_bzip2 <table_size::small>;
@@ -661,6 +661,7 @@ namespace large
661661 using crc16_modbus = family::crc16_modbus <table_size::large>;
662662 using crc16_x25 = family::crc16_x25 <table_size::large>;
663663 using crc16_xmodem = family::crc16_xmodem <table_size::large>;
664+ using crc16_m17lsf = family::crc16_m17lsf <table_size::large>;
664665
665666 using crc32 = family::crc32 <table_size::large>;
666667 using crc32_bzip2 = family::crc32_bzip2 <table_size::large>;
@@ -713,6 +714,7 @@ namespace tiny
713714 using crc16_modbus = family::crc16_modbus <table_size::tiny>;
714715 using crc16_x25 = family::crc16_x25 <table_size::tiny>;
715716 using crc16_xmodem = family::crc16_xmodem <table_size::tiny>;
717+ using crc16_m17lsf = family::crc16_m17lsf <table_size::tiny>;
716718
717719 using crc32 = family::crc32 <table_size::tiny>;
718720 using crc32_bzip2 = family::crc32_bzip2 <table_size::tiny>;
@@ -728,9 +730,6 @@ namespace tiny
728730
729731} // namespace tiny
730732
731- // select the default size
732- using namespace small ;
733-
734733} // namespace crc_cpp
735734
736735#undef CRC_CPP_STD20_MODE
0 commit comments