MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / parserSignature

Function parserSignature

app/src/Misc/BackupManager.cpp:272–284  ·  view source on GitHub ↗

* @brief Hashes the per-source frame parser code so two summaries can be compared for a * parser-only change; empty when no sources carry parser code. */

Source from the content-addressed store, hash-verified

270 * parser-only change; empty when no sources carry parser code.
271 */
272static QString parserSignature(const QJsonArray& sources)
273{
274 QByteArray acc;
275 for (const auto& sv : sources) {
276 acc.append(sv.toObject().value(Keys::FrameParserCode).toString().toUtf8());
277 acc.append('\n');
278 }
279
280 if (acc.isEmpty())
281 return {};
282
283 return QString::fromLatin1(QCryptographicHash::hash(acc, QCryptographicHash::Sha1).toHex());
284}
285
286/**
287 * @brief Returns a structural summary of a snapshot file (title, counts, group titles).

Callers 2

summarizeMethod · 0.85
currentSummaryMethod · 0.85

Calls 4

isEmptyMethod · 0.80
toHexMethod · 0.80
appendMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected