dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Language: s/error_log/wfWarn/"
[lhc/web/wiklou.git]
/
includes
/
utils
/
MWCryptRand.php
diff --git
a/includes/utils/MWCryptRand.php
b/includes/utils/MWCryptRand.php
index
eb74d12
..
b602f78
100644
(file)
--- a/
includes/utils/MWCryptRand.php
+++ b/
includes/utils/MWCryptRand.php
@@
-61,6
+61,7
@@
class MWCryptRand {
/**
* Initialize an initial random state based off of whatever we can find
/**
* Initialize an initial random state based off of whatever we can find
+ * @return string
*/
protected function initialRandomState() {
// $_SERVER contains a variety of unstable user and system specific information
*/
protected function initialRandomState() {
// $_SERVER contains a variety of unstable user and system specific information
@@
-147,7
+148,7
@@
class MWCryptRand {
* Randomly hash data while mixing in clock drift data for randomness
*
* @param string $data The data to randomly hash.
* Randomly hash data while mixing in clock drift data for randomness
*
* @param string $data The data to randomly hash.
- * @return
S
tring The hashed bytes
+ * @return
s
tring The hashed bytes
* @author Tim Starling
*/
protected function driftHash( $data ) {
* @author Tim Starling
*/
protected function driftHash( $data ) {
@@
-214,7
+215,7
@@
class MWCryptRand {
/**
* Decide on the best acceptable hash algorithm we have available for hash()
* @throws MWException
/**
* Decide on the best acceptable hash algorithm we have available for hash()
* @throws MWException
- * @return
S
tring A hash algorithm
+ * @return
s
tring A hash algorithm
*/
protected function hashAlgo() {
if ( !is_null( $this->algo ) ) {
*/
protected function hashAlgo() {
if ( !is_null( $this->algo ) ) {
@@
-259,8
+260,8
@@
class MWCryptRand {
* Generate an acceptably unstable one-way-hash of some text
* making use of the best hash algorithm that we have available.
*
* Generate an acceptably unstable one-way-hash of some text
* making use of the best hash algorithm that we have available.
*
- * @param
$data string
- * @return
S
tring A raw hash of the data
+ * @param
string $data
+ * @return
s
tring A raw hash of the data
*/
protected function hash( $data ) {
return hash( $this->hashAlgo(), $data, true );
*/
protected function hash( $data ) {
return hash( $this->hashAlgo(), $data, true );
@@
-270,9
+271,9
@@
class MWCryptRand {
* Generate an acceptably unstable one-way-hmac of some text
* making use of the best hash algorithm that we have available.
*
* Generate an acceptably unstable one-way-hmac of some text
* making use of the best hash algorithm that we have available.
*
- * @param
$data string
- * @param
$key string
- * @return
S
tring A raw hash of the data
+ * @param
string $data
+ * @param
string $key
+ * @return
s
tring A raw hash of the data
*/
protected function hmac( $data, $key ) {
return hash_hmac( $this->hashAlgo(), $data, $key, true );
*/
protected function hmac( $data, $key ) {
return hash_hmac( $this->hashAlgo(), $data, $key, true );
@@
-487,11
+488,11
@@
class MWCryptRand {
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param int $bytes
t
he number of bytes of random data to generate
+ * @param int $bytes
T
he number of bytes of random data to generate
* @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
* @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
- * @return
S
tring Raw binary random data
+ * @return
s
tring Raw binary random data
*/
public static function generate( $bytes, $forceStrong = false ) {
return self::singleton()->realGenerate( $bytes, $forceStrong );
*/
public static function generate( $bytes, $forceStrong = false ) {
return self::singleton()->realGenerate( $bytes, $forceStrong );
@@
-503,11
+504,11
@@
class MWCryptRand {
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param int $chars
t
he number of hex chars of random data to generate
+ * @param int $chars
T
he number of hex chars of random data to generate
* @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
* @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
- * @return
S
tring Hexadecimal random data
+ * @return
s
tring Hexadecimal random data
*/
public static function generateHex( $chars, $forceStrong = false ) {
return self::singleton()->realGenerateHex( $chars, $forceStrong );
*/
public static function generateHex( $chars, $forceStrong = false ) {
return self::singleton()->realGenerateHex( $chars, $forceStrong );