Update index.js
A little optimization trick: hex.length will not change, so we can avoid to evaluate it each time we loop.
Cette révision appartient à :
Parent
10305efe0c
révision
14a4fdf7fd
2
index.js
2
index.js
@ -214,7 +214,7 @@ var intToBytes = function(num) {
|
||||
*/
|
||||
var hexToBytes = function(hex) {
|
||||
var bytes = [];
|
||||
for(var c = 0; c < hex.length; c += 2) {
|
||||
for(var c = 0, C = hex.length; c < C; c += 2) {
|
||||
bytes.push(parseInt(hex.substr(c, 2), 16));
|
||||
}
|
||||
return bytes;
|
||||
|
||||
Chargement…
x
Référencer dans un nouveau ticket
Bloquer un utilisateur