Remove more DEP005 warning

This commit is contained in:
Godzil 2018-06-26 21:54:12 +01:00
parent e2a4ba738f
commit 2545c36241

View File

@ -24,8 +24,8 @@ export default function(id: number, iv: Buffer|string, data: Buffer|string,
*/
function decrypt(id: number, iv: Buffer|string, data: Buffer|string)
{
const ivBuffer = typeof iv === 'string' ? new Buffer(iv, 'base64') : iv;
const dataBuffer = typeof data === 'string' ? new Buffer(data, 'base64') : data;
const ivBuffer = typeof iv === 'string' ? Buffer.from(iv, 'base64') : iv;
const dataBuffer = typeof data === 'string' ? Buffer.from(data, 'base64') : data;
const decipher = crypto.createDecipheriv('aes-256-cbc', key(id), ivBuffer);
decipher.setAutoPadding(false);