From 1a00cdb2911b8e7835ddd44af3c5625d6cf3e563 Mon Sep 17 00:00:00 2001 From: Dave Holoway Date: Sun, 18 Aug 2019 14:53:54 +0100 Subject: [PATCH] Replace new Buffer() constructor calls (#69) --- src/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.js b/src/util.js index e98f489..1e2bbdb 100644 --- a/src/util.js +++ b/src/util.js @@ -627,9 +627,9 @@ exports.dumparr = function (arr, offset, count) { } exports.btoa = function (arr) { - return new Buffer(arr, 'binary').toString('base64'); + return Buffer.from(arr, 'binary').toString('base64'); } exports.atob = function (base64) { - return new Buffer(base64, 'base64').toString('binary'); + return Buffer.from(base64, 'base64').toString('binary'); }