class RandomBytesRandomStringGenerator implements RandomStringGenerator

Class RandomBytesRandomStringGenerator

Traits

Class RandomStringGeneratorTrait

Constants

ERROR_MESSAGE

Methods

validateLength(int $length)

Validates the length argument of a random string.

string
binToHex(string $binaryData, int $length)

Converts binary data to hexadecimal of arbitrary length.

__construct()

RandomBytesRandomStringGenerator constructor.

string
getRandomString($length)

生成一个指定长度的随机字符串

Details

validateLength(int $length)

Validates the length argument of a random string.

Parameters

int $length The length to validate.

Exceptions

InvalidArgumentException

string binToHex(string $binaryData, int $length)

Converts binary data to hexadecimal of arbitrary length.

Parameters

string $binaryData The binary data to convert to hex.
int $length The length of the string to return.

Return Value

string

at line 26
__construct()

RandomBytesRandomStringGenerator constructor.

Exceptions

YfySdkException

at line 41
string getRandomString($length)

生成一个指定长度的随机字符串

Parameters

$length string 随机字符串的长度

Return Value

string