pssht  latest
SSH server library written in PHP
OpenSSL.php
1 <?php
2 
3 /*
4 * This file is part of pssht.
5 *
6 * (c) François Poirotte <clicky@erebot.net>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 
12 namespace fpoirotte\Pssht\Random;
13 
17 class OpenSSL implements RandomInterface
18 {
20  public function __construct()
21  {
22  }
23 
24  public function getBytes($count)
25  {
26  if (!is_int($count) || $count <= 0) {
27  throw new \InvalidArgumentException();
28  }
29 
30  $value = openssl_random_pseudo_bytes($count, $strong);
31 
33  if (!$strong) {
34  ;
35  }
36  return $value;
37  }
38 }
__construct()
Construct a new PRNG.
Definition: OpenSSL.php:20