🎨 Replace new Buffer() by Buffer.alloc()

This commit is contained in:
C-3PO 2018-07-05 02:37:00 +02:00
parent 1d1b8930cf
commit 26467816f0
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -3,7 +3,7 @@ import updateKeys from './lib/updateKeys';
export default function decryptChunk(encryptedChunk: Buffer, [key0, key1, key2]: [number, number, number]): Buffer { export default function decryptChunk(encryptedChunk: Buffer, [key0, key1, key2]: [number, number, number]): Buffer {
const dv = new DataView(encryptedChunk.buffer); const dv = new DataView(encryptedChunk.buffer);
const decryptedChunk = new Buffer(encryptedChunk.length); const decryptedChunk = Buffer.alloc(encryptedChunk.length);
const dvOut = new DataView(decryptedChunk.buffer); const dvOut = new DataView(decryptedChunk.buffer);
for (let i = 0; i < encryptedChunk.length; i += 1) { for (let i = 0; i < encryptedChunk.length; i += 1) {