Merge pull request #27 from homakov/patch-1
Fix bug when v is < 1000000 and substr fails
Esse commit está contido em:
commit
3db472249f
4
index.js
4
index.js
@ -43,9 +43,9 @@ hotp.gen = function(key, opt) {
|
||||
(h[offset + 2] & 0xff) << 8 |
|
||||
(h[offset + 3] & 0xff);
|
||||
|
||||
v = v + '';
|
||||
v = (v % 1000000) + '';
|
||||
|
||||
return v.substr(v.length - p, p);
|
||||
return Array(7-v.length).join('0') + v;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Carregando…
x
Referência em uma nova issue
Block a user