algorithm, $algos, true)) { throw new RNGException('Unsupported algorithm specified'); } } /** * {@inheritdoc} */ public function getRandomBytes(int $bytecount): string { $result = ''; $hash = mt_rand(); for ($i = 0; $i < $bytecount; $i++) { $hash = hash($this->algorithm, $hash . mt_rand(), true); $result .= $hash[mt_rand(0, strlen($hash) - 1)]; } return $result; } /** * {@inheritdoc} */ public function isCryptographicallySecure(): bool { return false; } }