4 ms·
How does that look like in practice? I mean, you can’t use the table-based per-byte approach because you can’t store the lookup table with constexpr, so I guess
by layoutIfNeeded 6y ago
How does that look like in practice? I mean, you can’t use the table-based per-byte approach because you can’t store the lookup table with constexpr, so I guess you must be doing polynomial division via bit shifts and such, right?
- TeMPOraL 6y ago> you can’t store the lookup table with constexpr IIRC you can store a null-terminated string as constexpr, right? If so, then there's your lookup table.
- Google234 6y agoAlso I think absl has a constexpr map too.
- layoutIfNeeded 6y agoBut string literals are const, so you won’t be able to fill the lookup table based on the generator polynomial.
- fwsgonzo 6y agoThere is a table, here is the code: https://github.com/fwsGonzo/rvscript/blob/master/engine/script/util/crc32.hpp https://github.com/fwsGonzo/rvscript/blob/master/engine/scri...
- layoutIfNeeded 6y agoAh, true! I wasn’t aware that std::array was compatible with constexpr.
- sgerenser 6y agoI’ve done compile time crc32 string hashing for similar reasons with a raw array as a lookup table.