1 | <?php |
||
9 | class OpenSslRandomStringGenerator implements RandomStringGeneratorInterface |
||
10 | { |
||
11 | use RandomStringGeneratorTrait; |
||
12 | |||
13 | /** |
||
14 | * The error message when generating the string fails. |
||
15 | * |
||
16 | * @const string |
||
17 | */ |
||
18 | const ERROR_MESSAGE = 'Unable to generate a cryptographically secure pseudo-random string from openssl_random_pseudo_bytes(). '; |
||
19 | |||
20 | /** |
||
21 | * Create a new OpenSslRandomStringGenerator instance |
||
22 | * |
||
23 | * @throws \Dropbox\Exceptions\DropboxClientException |
||
24 | */ |
||
25 | public function __construct() |
||
34 | |||
35 | /** |
||
36 | * Get a randomly generated secure token |
||
37 | * |
||
38 | * @param int $length Length of the string to return |
||
39 | * |
||
40 | * @throws \Dropbox\Exceptions\DropboxClientException |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function generateString($length) |
||
63 | } |
||
64 |