[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
(no description)
File Size: | 516 lines (19 kb) |
Included or required: | 0 times |
Referenced: | 1 time |
Includes or requires: | 0 files |
MWCryptRand:: (14 methods):
initialRandomState()
driftHash()
randomState()
hashAlgo()
hashLength()
hash()
hmac()
realWasStrong()
realGenerate()
realGenerateHex()
singleton()
wasStrong()
generate()
generateHex()
Class: MWCryptRand - X-Ref
A cryptographic random generator class used for generating secret keysinitialRandomState() X-Ref |
Initialize an initial random state based off of whatever we can find return: string |
driftHash( $data ) X-Ref |
Randomly hash data while mixing in clock drift data for randomness author: Tim Starling param: string $data The data to randomly hash. return: string The hashed bytes |
randomState() X-Ref |
Return a rolling random state initially build using data from unstable sources return: string A new weak random state |
hashAlgo() X-Ref |
Decide on the best acceptable hash algorithm we have available for hash() return: string A hash algorithm |
hashLength() X-Ref |
Return the byte-length output of the hash algorithm we are using in self::hash and self::hmac. return: int Number of bytes the hash outputs |
hash( $data ) X-Ref |
Generate an acceptably unstable one-way-hash of some text making use of the best hash algorithm that we have available. param: string $data return: string A raw hash of the data |
hmac( $data, $key ) X-Ref |
Generate an acceptably unstable one-way-hmac of some text making use of the best hash algorithm that we have available. param: string $data param: string $key return: string A raw hash of the data |
realWasStrong() X-Ref |
realGenerate( $bytes, $forceStrong = false ) X-Ref |
realGenerateHex( $chars, $forceStrong = false ) X-Ref |
singleton() X-Ref |
Return a singleton instance of MWCryptRand return: MWCryptRand |
wasStrong() X-Ref |
Return a boolean indicating whether or not the source used for cryptographic random bytes generation in the previously run generate* call was cryptographically strong. return: bool Returns true if the source was strong, false if not. |
generate( $bytes, $forceStrong = false ) X-Ref |
Generate a run of (ideally) cryptographically random data and return it in raw binary form. You can use MWCryptRand::wasStrong() if you wish to know if the source used was cryptographically strong. param: int $bytes The number of bytes of random data to generate param: bool $forceStrong Pass true if you want generate to prefer cryptographically return: string Raw binary random data |
generateHex( $chars, $forceStrong = false ) X-Ref |
Generate a run of (ideally) cryptographically random data and return it in hexadecimal string format. You can use MWCryptRand::wasStrong() if you wish to know if the source used was cryptographically strong. param: int $chars The number of hex chars of random data to generate param: bool $forceStrong Pass true if you want generate to prefer cryptographically return: string Hexadecimal random data |
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |