crypto.cpp File Reference

Provides support for pseuodrandom number generation. More...

#include <QFile>
#include <QStringList>
#include <QtDebug>
#include "crypto.h"

Go to the source code of this file.

Functions

QByteArray crypto_rand_bytes (int len)
quint32 crypto_rand_quint32 (quint32 max)
QString crypto_rand_string (int len)


Detailed Description

Provides support for pseuodrandom number generation.

Version:
Id

Definition in file crypto.cpp.


Function Documentation

QByteArray crypto_rand_bytes ( int  len  ) 

Returns len bytes of pseudorandom data on success, or an empty QByteArray on failure. This function is based on crypto_seed_rng() from Tor's crypto.c. See LICENSE for details on Tor's license.

Definition at line 79 of file crypto.cpp.

Referenced by crypto_rand_quint32().

quint32 crypto_rand_quint32 ( quint32  max  ) 

Returns a pseudorandom integer, chosen uniformly from the the values in the range [0, max). This function is based on crypto_rand_int() from Tor's crypto.c. See LICENSE for details on Tor's license.

Definition at line 136 of file crypto.cpp.

Referenced by crypto_rand_string().

QString crypto_rand_string ( int  len  ) 

Generates a pseudorandom string of length len containing printable ASCII characters of length from the range '!' (0x21) to '~' (0x7e).

Definition at line 158 of file crypto.cpp.

Referenced by TorSettings::generateRandomPassword().


Generated on Wed Sep 5 15:49:28 2007 for Vidalia by  doxygen 1.5.3