#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;
}
General class for hashing algorithms.
Definition: qca_basic.h:209
void update(const MemoryRegion &a) override
Update a hash, adding more of the message contents to the digest.
MemoryRegion final() override
Finalises input and returns the hash result.
QString hashToString(const MemoryRegion &array)
Hash a byte array, returning it as a printable string
Convenience method for initialising and cleaning up QCA.
Definition: qca_core.h:660
Secure array of bytes.
Definition: qca_tools.h:317
char * data()
Pointer to the data in the secure array.
QByteArray toByteArray() const
Copy the contents of the secure array out to a standard QByteArray.
QCA_EXPORT void init()
Initialise QCA.
QCA_EXPORT QString arrayToHex(const QByteArray &array)
Convert a byte array to printable hexadecimal representation.
QCA_EXPORT bool isSupported(const char *features, const QString &provider=QString())
Test if a capability (algorithm) is available.