Skip to content

Commit 1fd4d5d

Browse files
authored
Merge pull request blueimp#16 from Connormiha/master
minor performance optimization
2 parents d92d988 + 534c7a7 commit 1fd4d5d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/md5.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@
164164
function binl2rstr (input) {
165165
var i
166166
var output = ''
167-
for (i = 0; i < input.length * 32; i += 8) {
167+
var length32 = input.length * 32
168+
for (i = 0; i < length32; i += 8) {
168169
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF)
169170
}
170171
return output
@@ -181,7 +182,8 @@
181182
for (i = 0; i < output.length; i += 1) {
182183
output[i] = 0
183184
}
184-
for (i = 0; i < input.length * 8; i += 8) {
185+
var length8 = input.length * 8
186+
for (i = 0; i < length8; i += 8) {
185187
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32)
186188
}
187189
return output

0 commit comments

Comments
 (0)