| 1 |
<?php |
| 2 |
|
| 3 |
namespace WindPressPackages\Hidehalo\Nanoid; |
| 4 |
|
| 5 |
interface CoreInterface |
| 6 |
{ |
| 7 |
const SAFE_SYMBOLS = '_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
| 8 |
const MASKS = [15, 31, 63, 127, 255]; |
| 9 |
/** |
| 10 |
* Secure random string generator with custom alphabet. |
| 11 |
* Alphabet must contain 256 symbols or less. Otherwise, the generator |
| 12 |
* will not be secure. |
| 13 |
* |
| 14 |
* @param GeneratorInterface $generator |
| 15 |
* @param string $alphabet |
| 16 |
* @param integer $size |
| 17 |
*/ |
| 18 |
public function random(GeneratorInterface $generator, $size, $alphabet = CoreInterface::SAFE_SYMBOLS); |
| 19 |
} |
| 20 |
|