Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down