• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

qca

QCA::Random

QCA::Random Class Reference
[QCA user API]

#include <QtCrypto>

Inheritance diagram for QCA::Random:

Inheritance graph
[legend]

List of all members.


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

QCA::Random::Random ( const QString &  provider = QString()  ) 

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.

Random & QCA::Random::operator= ( const Random &  from  ) 

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:
  • qca_basic.h
  • qca_basic.cpp

qca

Skip menu "qca"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • akonadi
  • Decibel
  • eigen
  • Eigen2
  • kdewin32
  • Phonon
  •     Backend
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal