diff --git a/index.js b/index.js index b4718fc..45542db 100644 --- a/index.js +++ b/index.js @@ -119,7 +119,7 @@ var totp = {}; totp.gen = function(key, opt) { opt = opt || {}; var time = opt.time || 30; - var _t = new Date().getTime(); + var _t = Date.now(); // Time has been overwritten. if(opt._t) { @@ -170,7 +170,7 @@ totp.gen = function(key, opt) { totp.verify = function(token, key, opt) { opt = opt || {}; var time = opt.time || 30; - var _t = new Date().getTime(); + var _t = Date.now(); // Time has been overwritten. if(opt._t) {