Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions js/lib/otp.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ window.OTP = (function () {
}

for (i = 0; i + 4 <= bits.length; i += 4) {
var chunk = bits.substr(i, 4);
var chunk = bits.slice(i, i + 4);
hex = hex + parseInt(chunk, 2).toString(16);
}
return hex;
Expand Down Expand Up @@ -51,8 +51,8 @@ window.OTP = (function () {
var hmacObj = new jsSHA(time, 'HEX');
var hmac = hmacObj.getHMAC(key, 'HEX', 'SHA-1', "HEX");
var offset = hex2dec(hmac.substring(hmac.length - 1));
var otp = (hex2dec(hmac.substr(offset * 2, 8)) & hex2dec('7fffffff')) + '';
otp = (otp).substr(otp.length - 6, 6);
var otp = (hex2dec(hmac.slice(offset * 2, offset * 2 + 8)) & hex2dec('7fffffff')) + '';
otp = (otp).slice(-6);
return otp;
}
};
Expand Down
2 changes: 1 addition & 1 deletion js/ui/popup/directives/otp.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}

for (i = 0; i + 4 <= bits.length; i += 4) {
var chunk = bits.substr(i, 4);
var chunk = bits.slice(i, i + 4);
hex = hex + parseInt(chunk, 2).toString(16);
}
return hex;
Expand Down
2 changes: 1 addition & 1 deletion js/ui/popup/factories/httpsTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
};

tester.isHTTP = function (url) {
return url.substr(0,5) === 'http:';
return url.slice(0,5) === 'http:';
};

return tester;
Expand Down