MediaWiki REL1_30
MWCryptRand.php
Go to the documentation of this file.
1<?php
28
33 protected static function singleton() {
34 return MediaWikiServices::getInstance()->getCryptRand();
35 }
36
44 public static function wasStrong() {
45 return self::singleton()->wasStrong();
46 }
47
60 public static function generate( $bytes, $forceStrong = false ) {
61 return self::singleton()->generate( $bytes, $forceStrong );
62 }
63
76 public static function generateHex( $chars, $forceStrong = false ) {
77 return self::singleton()->generateHex( $chars, $forceStrong );
78 }
79}
static wasStrong()
Return a boolean indicating whether or not the source used for cryptographic random bytes generation ...
static generate( $bytes, $forceStrong=false)
Generate a run of (ideally) cryptographically random data and return it in raw binary form.
static generateHex( $chars, $forceStrong=false)
Generate a run of (ideally) cryptographically random data and return it in hexadecimal string format.
static singleton()
MediaWikiServices is the service locator for the application scope of MediaWiki.