25#include <QCoreApplication>
31#include "import_plugins.h"
34int main(
int argc,
char **argv)
42 qDebug() <<
"This example generates random numbers";
47 qDebug() <<
"A random number: " << randInt;
51 unsigned char randChar;
54 std::cout <<
"A random character: " << randChar << std::endl;
62 std::cout <<
"A random 10 byte array (in hex): ";
63 std::cout << qPrintable(
QCA::Hex().arrayToString(tenBytes)) << std::endl;
69 randChar = myRandomObject.
nextByte();
Hexadecimal encoding / decoding.
Convenience method for initialising and cleaning up QCA.
Source of random numbers.
uchar nextByte()
Provide a random byte.
static SecureArray randomArray(int size)
Provide a specified number of random bytes.
static int randomInt()
Provide a random integer.
static uchar randomChar()
Provide a random character (byte)
SecureArray nextBytes(int size)
Provide a specified number of random bytes.
void init(KXmlGuiWindow *window, KGameDifficulty *difficulty=nullptr)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:55 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.