The code below shows how to use the QCA::Hash class
#include <QtCrypto>
#include <QCoreApplication>
#include <cstdio>
#ifdef QT_STATICPLUGIN
#include "import_plugins.h"
#endif
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
printf("SHA1 not supported!\n");
else {
printf(
"sha1(\"%s\") = [%s]\n", arg.
data(), qPrintable(result));
}
printf("MD5 not supported!\n");
else {
printf(
"md5(\"%s\") = [%s]\n", arg.
data(), qPrintable(result));
}
return 0;
}
QCA_EXPORT bool isSupported(const char *features, const QString &provider=QString())
Test if a capability (algorithm) is available.