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');