// SPDX-License-Identifier: MIT #include "openpu/vin.hpp" #include namespace openpu { std::string normalizeVin(std::string_view input) { std::string out; out.reserve(input.size()); for (char c : input) { const auto uc = static_cast(c); if (std::isspace(uc) != 0) continue; out.push_back(static_cast(std::toupper(uc))); } return out; } bool isValidVin(std::string_view vin) { if (vin.size() != 17) return false; if (vin[0] != 'V' || (vin[1] != 'F' && vin[1] != 'R') || vin[2] != '3') return false; for (std::size_t i = 3; i < vin.size(); ++i) { const char c = vin[i]; const bool ok = (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'); if (!ok) return false; } return true; } } // namespace openpu