* @brief Computes a checksum or CRC value for the given data using the specified algorithm. */
| 324 | * @brief Computes a checksum or CRC value for the given data using the specified algorithm. |
| 325 | */ |
| 326 | QByteArray IO::checksum(const QString& name, const QByteArray& data) |
| 327 | { |
| 328 | const auto& map = checksumFunctionMap(); |
| 329 | const auto it = map.find(name); |
| 330 | if (it != map.end()) |
| 331 | return it.value()(data.constData(), data.size()); |
| 332 | |
| 333 | return {}; |
| 334 | } |