Skip to content

Commit 5b8958d

Browse files
committed
update phpdoc
1 parent 8d55f0a commit 5b8958d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/WebPush.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ public function sendNotifications(array $endpoints, array $payloads = null, arra
135135
* @param string $payload
136136
*
137137
* @return array
138-
*
139-
* @throws
140138
*/
141139
private function encrypt($userPublicKey, $payload)
142140
{
@@ -158,7 +156,7 @@ private function encrypt($userPublicKey, $payload)
158156
$sharedSecret = $userPublicKeyObject->getPoint()->mul($localPrivateKeyObject->getSecret())->getX();
159157

160158
// generate salt
161-
$salt = base64_encode(openssl_random_pseudo_bytes(16));
159+
$salt = openssl_random_pseudo_bytes(16);
162160

163161
// get encryption key
164162
$encryptionKey = hash_hmac('sha256', $salt, $sharedSecret);
@@ -169,7 +167,7 @@ private function encrypt($userPublicKey, $payload)
169167

170168
return array(
171169
'localPublicKey' => $localPublicKey,
172-
'salt' => $salt,
170+
'salt' => base64_encode($salt),
173171
'cipherText' => $cipherText,
174172
);
175173
}

0 commit comments

Comments
 (0)