Random\Engine\Secure::generate

(PHP 8 >= 8.2.0)

Random\Engine\Secure::generateGenerate cryptographically secure randomness

说明

public Random\Engine\Secure::generate(): string

Returns cryptographically secure randomness.

此函数使用的随机性来源如下:

参数

此函数没有参数。

返回值

A string containing PHP_INT_SIZE cryptographically secure random bytes.

错误/异常

范例

示例 #1 Random\Engine\Secure::generate() example

<?php

/* ... */

?>

以上例程的输出类似于:

...