Skip to content

Commit

Permalink
Merge pull request mozilla#18993 from Snuffleupagus/stringToUTF16HexS…
Browse files Browse the repository at this point in the history
…tring-hexNumbers

Use the `hexNumbers` structure in the `stringToUTF16HexString` helper
  • Loading branch information
Snuffleupagus authored Nov 2, 2024
2 parents 06f3b2d + 2145a7b commit aa4839e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/core_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
AnnotationEditorPrefix,
assert,
BaseException,
hexNumbers,
objectSize,
stringToPDFString,
Util,
Expand Down Expand Up @@ -634,10 +635,7 @@ function stringToUTF16HexString(str) {
const buf = [];
for (let i = 0, ii = str.length; i < ii; i++) {
const char = str.charCodeAt(i);
buf.push(
((char >> 8) & 0xff).toString(16).padStart(2, "0"),
(char & 0xff).toString(16).padStart(2, "0")
);
buf.push(hexNumbers[(char >> 8) & 0xff], hexNumbers[char & 0xff]);
}
return buf.join("");
}
Expand Down
1 change: 1 addition & 0 deletions src/shared/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ export {
getModificationDate,
getUuid,
getVerbosityLevel,
hexNumbers,
IDENTITY_MATRIX,
ImageKind,
info,
Expand Down

0 comments on commit aa4839e

Please sign in to comment.