From ed1228568002b8aec5c46db76b84016cafb41768 Mon Sep 17 00:00:00 2001 From: Dener Miranda Date: Fri, 28 Aug 2020 14:12:46 -0300 Subject: [PATCH] Fix deprecation warning on Buffer use Updates main code block to use Buffer.from() instead of former Buffer() due to deprecation warnings. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0ab57b5..032deb2 100644 --- a/index.js +++ b/index.js @@ -92,8 +92,8 @@ function _password_crypt(algo, password, setting) { // Convert the base 2 logarithm into an integer. var count = 1 << count_log2; - password = new Buffer(password); - salt = new Buffer(salt); + password = Buffer.from(password); + salt = Buffer.from(salt); // We rely on the hash() function being available in PHP 5.2+. var hashed = hash(algo, Buffer.concat([salt, password]));