The code below shows some simple operations on a QCA::Hex object, converting between QCA::SecureArray and QString.
The code below shows some simple operations on a QCA::Hex object, converting between QCA::SecureArray and QString.
#include <QtCrypto>
#include <QCoreApplication>
#include <iostream>
#ifdef QT_STATICPLUGIN
#include "import_plugins.h"
#endif
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QByteArray arg;
arg.append((argc >= 2) ? argv[1] : "hello");
std::cout << arg.data() << " in hex encoding is ";
std::cout << encoded.toLatin1().data() << std::endl;
std::cout << encoded.toLatin1().data() << " decoded from hex is ";
std::cout << decoded.toLatin1().data() << std::endl;
return 0;
}
Hexadecimal encoding / decoding.
Definition qca_textfilter.h:165
Convenience method for initialising and cleaning up QCA.
Definition qca_core.h:660
QString arrayToString(const MemoryRegion &a)
Process an array in the "forward" direction, returning a QString.
QString decodeString(const QString &s)
Process a string in the "reverse" direction, returning a string.
@ Decode
Operate in the "reverse" direction; for example, decrypting.
Definition qca_core.h:143