| 1 | <?php |
||
| 9 | class McryptRandomStringGenerator 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 mcrypt_create_iv(). '; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Create a new McryptRandomStringGenerator instance |
||
| 22 | * |
||
| 23 | * @throws \Dropbox\Exceptions\DropboxClientException |
||
| 24 | */ |
||
| 25 | 58 | 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) |
||
| 60 | } |
||
| 61 |