diff options
author | tailor <cygnus@janrain.com> | 2005-12-28 21:51:18 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2005-12-28 21:51:18 +0000 |
commit | 3594ce31eab937a9745c93e45ec341b3e7bc27d0 (patch) | |
tree | 6296151e7144359205bb414e78e254d2b364b2a2 /Net/OpenID/CryptUtil.php | |
parent | 086733dc33b49df111c92e985ace6b897d91946d (diff) | |
download | php-openid-3594ce31eab937a9745c93e45ec341b3e7bc27d0.zip php-openid-3594ce31eab937a9745c93e45ec341b3e7bc27d0.tar.gz php-openid-3594ce31eab937a9745c93e45ec341b3e7bc27d0.tar.bz2 |
[project @ Fixed define syntax and comment indention.]
Diffstat (limited to 'Net/OpenID/CryptUtil.php')
-rw-r--r-- | Net/OpenID/CryptUtil.php | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/Net/OpenID/CryptUtil.php b/Net/OpenID/CryptUtil.php index 9249d5a..f26ca72 100644 --- a/Net/OpenID/CryptUtil.php +++ b/Net/OpenID/CryptUtil.php @@ -1,11 +1,11 @@ <?php -if (!defined(Net_OpenID_RAND_SOURCE)) { - /** - * The filename for a source of random bytes. Define this yourself if you - * have a different source of randomness. - */ - define('Net_OpenID_RAND_SOURCE', '/dev/urandom'); +if (!defined('Net_OpenID_RAND_SOURCE')) { + /** + * The filename for a source of random bytes. Define this yourself + * if you have a different source of randomness. + */ + define('Net_OpenID_RAND_SOURCE', '/dev/urandom'); } /** @@ -13,18 +13,19 @@ if (!defined(Net_OpenID_RAND_SOURCE)) { */ class Net_OpenID_CryptUtil { /** - * Get the specified number of random bytes. - * - * Attempts to use a cryptographically secure (not predictable) source of - * randomness if available. If there is no high-entropy randomness source - * available, it will fail. As a last resort, for non-critical systems, - * define <code>Net_OpenID_USE_INSECURE_RAND</code>, and the code will - * fall back on a pseudo-random number generator. - * - * @static - * @param int $num_bytes The length of the return value - * @return string $num_bytes random bytes - */ + * Get the specified number of random bytes. + * + * Attempts to use a cryptographically secure (not predictable) + * source of randomness if available. If there is no high-entropy + * randomness source available, it will fail. As a last resort, + * for non-critical systems, define + * <code>Net_OpenID_USE_INSECURE_RAND</code>, and the code will + * fall back on a pseudo-random number generator. + * + * @static + * @param int $num_bytes The length of the return value + * @return string $num_bytes random bytes + */ function getBytes($num_bytes) { $f = @fopen("/dev/urandom", "r"); if ($f === FALSE) { |