From aac3fc46c07f67ec745bd3d2f2483c36f07f835e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Coque?= <116288404+JoseCoque@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:00:45 -0300 Subject: [PATCH] fixing Buffer deprecation warning --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 3052c5e..e97bc91 100644 --- a/index.js +++ b/index.js @@ -56,9 +56,9 @@ hotp.gen = function(key, opt) { var p = 6; // Create the byte array - var b = new Buffer(intToBytes(counter)); + var b = Buffer.from(intToBytes(counter)); - var hmac = crypto.createHmac('sha1', new Buffer(key)); + var hmac = crypto.createHmac('sha1', Buffer.from(key)); // Update the HMAC with the byte array var digest = hmac.update(b).digest('hex');