qca
QCA::Random Class Reference
[QCA user API]
#include <QtCrypto>

Detailed Description
Source of random numbers.QCA provides a built in source of random numbers, which can be accessed through this class. You can also use an alternative random number source, by implementing another provider.
The normal use of this class is expected to be through the static members - randomChar(), randomInt() and randomArray().
Definition at line 62 of file qca_basic.h.
Public Member Functions | |
| uchar | nextByte () |
| SecureArray | nextBytes (int size) |
| Random & | operator= (const Random &from) |
| Random (const Random &from) | |
| Random (const QString &provider=QString()) | |
| ~Random () | |
Static Public Member Functions | |
| static SecureArray | randomArray (int size) |
| static uchar | randomChar () |
| static int | randomInt () |
Constructor & Destructor Documentation
Standard Constructor.
- Parameters:
-
provider the name of the provider library for the random number generation
Definition at line 118 of file qca_basic.cpp.
| QCA::Random::Random | ( | const Random & | from | ) |
Copy constructor.
- Parameters:
-
from the Random object to copy from
Definition at line 123 of file qca_basic.cpp.
| QCA::Random::~Random | ( | ) |
Definition at line 128 of file qca_basic.cpp.
Member Function Documentation
| uchar QCA::Random::nextByte | ( | ) |
Provide a random byte.
This method isn't normally required - you should use the static randomChar() method instead.
- See also:
- randomChar
Definition at line 138 of file qca_basic.cpp.
| SecureArray QCA::Random::nextBytes | ( | int | size | ) |
Provide a specified number of random bytes.
This method isn't normally required - you should use the static randomArray() method instead.
- Parameters:
-
size the number of bytes to provide
- See also:
- randomArray
Definition at line 143 of file qca_basic.cpp.
Assignment operator.
- Parameters:
-
from the Random object to copy state from
Definition at line 132 of file qca_basic.cpp.
| SecureArray QCA::Random::randomArray | ( | int | size | ) | [static] |
Provide a specified number of random bytes.
// build a 30 byte secure array. SecureArray arry = QCA::Random::randomArray(30);
- Parameters:
-
size the number of bytes to provide
Definition at line 163 of file qca_basic.cpp.
| uchar QCA::Random::randomChar | ( | ) | [static] |
Provide a random character (byte).
This is the normal way of obtaining a single random char (ie. 8 bit byte), as shown below:
myRandomChar = QCA::Random::randomChar();
If you need a number of bytes, perhaps randomArray() may be of use.
Definition at line 148 of file qca_basic.cpp.
| int QCA::Random::randomInt | ( | ) | [static] |
Provide a random integer.
This is the normal way of obtaining a single random integer, as shown below:
myRandomInt = QCA::Random::randomInt();
Definition at line 154 of file qca_basic.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference