| 729 | } |
| 730 | |
| 731 | QString BridgeApp::decode_data(const QString &algorithm, const QString &data, const QString &key) const |
| 732 | { |
| 733 | QString alg = algorithm.toLower(); |
| 734 | |
| 735 | if (alg == "hex") |
| 736 | return QString::fromUtf8(QByteArray::fromHex(data.toLatin1())); |
| 737 | if (alg == "base64") |
| 738 | return QString::fromUtf8(QByteArray::fromBase64(data.toLatin1())); |
| 739 | if (alg == "base32") |
| 740 | return QString::fromUtf8(decodeBase32(data.toLatin1())); |
| 741 | if (alg == "zip") |
| 742 | return QString::fromUtf8(qUncompress(QByteArray::fromBase64(data.toLatin1()))); |
| 743 | if (alg == "xor") |
| 744 | return QString::fromUtf8(applyXor(QByteArray::fromBase64(data.toLatin1()), key.toUtf8())); |
| 745 | |
| 746 | return data; |
| 747 | } |
| 748 | |
| 749 | QString BridgeApp::encode_file(const QString &algorithm, const QString &path, const QString &key) const |
| 750 | { |
nothing calls this directly
no test coverage detected