RandomGeneratorInterface.php 735 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * This file is part of the ramsey/uuid library
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
  9. * @license http://opensource.org/licenses/MIT MIT
  10. */
  11. declare(strict_types=1);
  12. namespace Ramsey\Uuid\Generator;
  13. /**
  14. * A random generator generates strings of random binary data
  15. */
  16. interface RandomGeneratorInterface
  17. {
  18. /**
  19. * Generates a string of randomized binary data
  20. *
  21. * @param int<1, max> $length The number of bytes to generate of random binary data
  22. *
  23. * @return string A binary string
  24. */
  25. public function generate(int $length): string;
  26. }