MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / getRemainder

Method getRemainder

Libraries/QRCode/tests/QrCode.cpp:592–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590
591
592std::vector<uint8_t> qrcodegen::QrCode::ReedSolomonGenerator::getRemainder(const std::vector<uint8_t> &data) const {
593 // Compute the remainder by performing polynomial division
594 std::vector<uint8_t> result(coefficients.size());
595 for (size_t i = 0; i < data.size(); i++) {
596 uint8_t factor = data.at(i) ^ result.at(0);
597 result.erase(result.begin());
598 result.push_back(0);
599 for (size_t j = 0; j < result.size(); j++)
600 result.at(j) ^= multiply(coefficients.at(j), factor);
601 }
602 return result;
603}
604
605
606uint8_t qrcodegen::QrCode::ReedSolomonGenerator::multiply(uint8_t x, uint8_t y) {

Callers 1

appendErrorCorrectionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected