Skip to content

Commit 098d35f

Browse files
committed
index: Avoid deprecated Buffer#slice.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent eb849a7 commit 098d35f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/main/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ function createMainWindow(): BrowserWindow {
239239
try {
240240
// Check that the data on the clipboard was encrypted to the key.
241241
const data = Buffer.from(clipboard.readText(), "hex");
242-
const iv = data.slice(0, 12);
243-
const ciphertext = data.slice(12, -16);
244-
const authTag = data.slice(-16);
242+
const iv = data.subarray(0, 12);
243+
const ciphertext = data.subarray(12, -16);
244+
const authTag = data.subarray(-16);
245245
const decipher = crypto.createDecipheriv("aes-256-gcm", key, iv, {
246246
authTagLength: 16,
247247
});

0 commit comments

Comments
 (0)