1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс Random

Открытые статические члены

static getInt ($min=0, $max=\PHP_INT_MAX)
static getString ($length, $caseSensitive=false)
static getStringByAlphabet ($length, $alphabet, $requireAll=false)
static getStringByCharsets ($length, $charsetList)
static getStringByArray (int $length, array $charsetList)
static getBytes ($length)

Поля данных

const RANDOM_BLOCK_LENGTH = 64
const ALPHABET_NUM = 1
const ALPHABET_ALPHALOWER = 2
const ALPHABET_ALPHAUPPER = 4
const ALPHABET_SPECIAL = 8
const ALPHABET_ALL = 15

Защищенные статические члены

static getPseudoRandomBlock ()
static getCharsetsForAlphabet ($alphabet)
static countBits ($value)

Статические защищенные данные

static $alphabet

Подробное описание

См. определение в файле random.php строка 5

Методы

◆ countBits()

countBits ( $value)
staticprotected

Returns number of bits needed to represent an integer

Аргументы
int$valueInteger value for calculate.
Возвращает
int

См. определение в файле random.php строка 283

◆ getBytes()

getBytes ( $length)
static

Returns random (if possible) byte string

Аргументы
int$lengthResult byte string length.
Возвращает
string

См. определение в файле random.php строка 177

◆ getCharsetsForAlphabet()

getCharsetsForAlphabet ( $alphabet)
staticprotected

Returns strings with charsets based on alpabet mask (see $this->alphabet)

Simple example (now arrays!): echo $this->getCharsetsforAlphabet(static::ALPHABET_NUM|static::ALPHABET_ALPHALOWER); //output: 0123456789abcdefghijklmnopqrstuvwxyz

echo $this->getCharsetsforAlphabet(static::ALPHABET_SPECIAL|static::ALPHABET_ALPHAUPPER); //output:ABCDEFGHIJKLMNOPQRSTUVWXYZ,.#!*$:-^}[]()_+=<>?&;

echo $this->getCharsetsforAlphabet(static::ALPHABET_ALL); //output: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.#!*$:-^}[]()_+=<>?&;

Аргументы
string$alphabetAlpabet masks (e.g. static::ALPHABET_NUM|static::ALPHABET_ALPHALOWER).
Возвращает
array

См. определение в файле random.php строка 263

◆ getInt()

getInt ( $min = 0,
$max = \PHP_INT_MAX )
static

Returns random integer with the given range

Аргументы
int$minThe lower bound of the range.
int$maxThe upper bound of the range.
Возвращает
int
Исключения

Bitrix\Main\SystemException

См. определение в файле random.php строка 30

◆ getPseudoRandomBlock()

getPseudoRandomBlock ( )
staticprotected

Returns pseudo random block

Возвращает
string

См. определение в файле random.php строка 228

◆ getString()

getString ( $length,
$caseSensitive = false )
static

Returns random (if possible) alphanum string

Аргументы
int$lengthResult string length.
bool$caseSensitiveGenerate case sensitive random string (e.g. SoMeRandom1).
Возвращает
string

См. определение в файле random.php строка 76

◆ getStringByAlphabet()

getStringByAlphabet ( $length,
$alphabet,
$requireAll = false )
static

Returns random (if possible) ASCII string for a given alphabet mask (

См. также
self::ALPHABET_ALL)
Аргументы
int$lengthResult string length.
int$alphabetAlphabet masks (e.g. Random::ALPHABET_NUM|Random::ALPHABET_ALPHALOWER).
bool$requireAllRequired chars from all the alphabet masks.
Возвращает
string

См. определение в файле random.php строка 94

◆ getStringByArray()

getStringByArray ( int $length,
array $charsetList )
static

This function places chars from every charset into the result string randomly.

Аргументы
int$lengthResult string length.
array$charsetListArray of charsets.
Возвращает
string

См. определение в файле random.php строка 135

◆ getStringByCharsets()

getStringByCharsets ( $length,
$charsetList )
static

Returns random (if possible) string for a given charset list.

Аргументы
int$lengthResult string length.
string$charsetListCharset list, must be ASCII.
Возвращает
string

См. определение в файле random.php строка 115

Поля

◆ $alphabet

$alphabet
staticprotected
Инициализатор
self::ALPHABET_NUM => '0123456789',
self::ALPHABET_ALPHALOWER => 'abcdefghijklmnopqrstuvwxyz',
self::ALPHABET_ALPHAUPPER => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
self::ALPHABET_SPECIAL => ',.#!*%$:-^@{}[]()_+=<>?&;'
)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804

См. определение в файле random.php строка 15

◆ ALPHABET_ALL

const ALPHABET_ALL = 15

См. определение в файле random.php строка 13

◆ ALPHABET_ALPHALOWER

const ALPHABET_ALPHALOWER = 2

См. определение в файле random.php строка 10

◆ ALPHABET_ALPHAUPPER

const ALPHABET_ALPHAUPPER = 4

См. определение в файле random.php строка 11

◆ ALPHABET_NUM

const ALPHABET_NUM = 1

См. определение в файле random.php строка 9

◆ ALPHABET_SPECIAL

const ALPHABET_SPECIAL = 8

См. определение в файле random.php строка 12

◆ RANDOM_BLOCK_LENGTH

const RANDOM_BLOCK_LENGTH = 64

См. определение в файле random.php строка 7


Объявления и описания членов класса находятся в файле: