diff --git a/src/Frame/HybiFrame.php b/src/Frame/HybiFrame.php index 0d8a7c1..d8357e3 100644 --- a/src/Frame/HybiFrame.php +++ b/src/Frame/HybiFrame.php @@ -131,13 +131,7 @@ public function encode(string $payload, int $type = Protocol::TYPE_TEXT, bool $m */ protected function generateMask() { - if (\extension_loaded('openssl')) { - return \openssl_random_pseudo_bytes(4); - } else { - // SHA1 is 128 bit (= 16 bytes) - // So we pack it into 32 bits - return \pack('N', \sha1(\spl_object_hash($this).\mt_rand(0, \PHP_INT_MAX).\uniqid('', true), true)); - } + return \random_bytes(4); } /**