Skip to content

Commit 99c5abe

Browse files
improve performance of latin1
1 parent 6e7e900 commit 99c5abe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/encoding/enc-latin1.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export const Latin1 = {
2727
} = wordArray;
2828

2929
// Convert
30-
const latin1Chars = [];
30+
let latin1Chars = '';
3131
for (let i = 0; i < sigBytes; i++) {
32-
const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
33-
latin1Chars.push(String.fromCharCode(bite));
32+
const byte = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
33+
latin1Chars += String.fromCharCode(byte);
3434
}
3535

36-
return latin1Chars.join('');
36+
return latin1Chars;
3737
},
3838

3939
/**

0 commit comments

Comments
 (0)