@syncfusion/ej2-pdf 25.1.41 → 25.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.41
3
+ * version : 25.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-pdf@*",
3
- "_id": "@syncfusion/ej2-pdf@25.1.40",
3
+ "_id": "@syncfusion/ej2-pdf@25.1.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-pBiQSd8rMc6N9jXuEse841ZfDh5gOANZFNGhT2im35bSEJ1Sg7+6HAvcuTUUEjU6v92Xm9oVgZpbOKyWC+d7Ug==",
5
+ "_integrity": "sha512-vqldWjmy3RjHr9lFc0s6OIA/usm/v9nfsEUtiJ57f74MsfDLPTKQRXGlOKkOKUj3ljrUkfn7JbjjW6K7OayEHA==",
6
6
  "_location": "/@syncfusion/ej2-pdf",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -21,8 +21,8 @@
21
21
  "/@syncfusion/ej2",
22
22
  "/@syncfusion/ej2-pdfviewer"
23
23
  ],
24
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.40.tgz",
25
- "_shasum": "d62d8fd1ff43ad30c2db1da539000197f57715f0",
24
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-pdf/-/ej2-pdf-25.1.42.tgz",
25
+ "_shasum": "3f06568c8e0bd79cdbcc53551c78de3dc406d5ba",
26
26
  "_spec": "@syncfusion/ej2-pdf@*",
27
27
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
28
28
  "author": {
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "bundleDependencies": false,
32
32
  "dependencies": {
33
- "@syncfusion/ej2-base": "~25.1.35",
34
- "@syncfusion/ej2-compression": "~25.1.35"
33
+ "@syncfusion/ej2-base": "~25.2.3",
34
+ "@syncfusion/ej2-compression": "~25.2.3"
35
35
  },
36
36
  "deprecated": false,
37
37
  "description": "Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.",
@@ -55,7 +55,7 @@
55
55
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/pdf"
56
56
  },
57
57
  "typings": "index.d.ts",
58
- "version": "25.1.41",
58
+ "version": "25.2.3",
59
59
  "sideEffects": false,
60
60
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
61
61
  }
@@ -12,7 +12,7 @@ var __extends = (this && this.__extends) || (function () {
12
12
  };
13
13
  })();
14
14
  import { _ExportHelper } from './xfdf-document';
15
- import { _stringToAnnotationFlags, _convertToColor, _encode, _byteArrayToHexString, _stringToBytes, _annotationFlagsToString, _convertStringToBytes, _bytesToString, _hexStringToByteArray, _decode } from './../utils';
15
+ import { _stringToAnnotationFlags, _convertToColor, _encode, _byteArrayToHexString, _stringToBytes, _annotationFlagsToString, _bytesToString, _hexStringToByteArray, _decode } from './../utils';
16
16
  import { _PdfDictionary, _PdfName, _PdfReference } from './../pdf-primitives';
17
17
  import { _PdfBaseStream, _PdfContentStream, _PdfStream } from './../base-stream';
18
18
  import { PdfAnnotationFlag } from './../enumerator';
@@ -69,9 +69,7 @@ var _JsonDocument = /** @class */ (function (_super) {
69
69
  if (typeof value === 'string' || (Array.isArray(value) && value.length === 1)) {
70
70
  value = _this._getValidString(typeof value === 'string' ? value : value[0]);
71
71
  _this._jsonData.push(_this._doubleQuotes, _this._colon, _this._doubleQuotes);
72
- for (var i = 0; i < value.length; i++) {
73
- _this._jsonData.push(value.charCodeAt(i));
74
- }
72
+ _this._jsonData = _stringToBytes(value, true, false, _this._jsonData);
75
73
  _this._jsonData.push(_this._doubleQuotes);
76
74
  }
77
75
  else {
@@ -104,7 +102,7 @@ var _JsonDocument = /** @class */ (function (_super) {
104
102
  var page = document.getPage(i);
105
103
  if (page && page.annotations.count > 0) {
106
104
  this._jsonData.push(i !== 0 && isAnnotationAdded ? this._comma : this._space, this._doubleQuotes);
107
- var pageNumber = _convertStringToBytes(i.toString(), []);
105
+ var pageNumber = _stringToBytes(i.toString(), true, false, []);
108
106
  pageNumber.forEach(function (entry) {
109
107
  _this._jsonData.push(entry);
110
108
  });
@@ -120,7 +118,7 @@ var _JsonDocument = /** @class */ (function (_super) {
120
118
  }
121
119
  count++;
122
120
  this._exportAnnotation(annotation, i);
123
- this._jsonData = _convertStringToBytes(this._convertToJson(this._table), this._jsonData);
121
+ this._jsonData = _stringToBytes(this._convertToJson(this._table), true, false, this._jsonData);
124
122
  this._table.clear();
125
123
  }
126
124
  }
@@ -753,7 +751,7 @@ var _JsonDocument = /** @class */ (function (_super) {
753
751
  _JsonDocument.prototype._parseJson = function (document, data) {
754
752
  this._document = document;
755
753
  this._crossReference = document._crossReference;
756
- var stringData = _bytesToString(data);
754
+ var stringData = _bytesToString(data, true);
757
755
  if (stringData.startsWith('{') && !stringData.endsWith('}')) {
758
756
  while (stringData.length > 0 && !stringData.endsWith('}')) {
759
757
  stringData = stringData.substring(0, stringData.length - 1);
@@ -1510,7 +1508,7 @@ var _JsonDocument = /** @class */ (function (_super) {
1510
1508
  this._crossReference._cacheMap.set(value, stream);
1511
1509
  }
1512
1510
  else if (keys.indexOf('unicodeData') !== -1) {
1513
- value = _bytesToString(_hexStringToByteArray(element.unicodeData, true));
1511
+ value = _bytesToString(_hexStringToByteArray(element.unicodeData, false));
1514
1512
  }
1515
1513
  else {
1516
1514
  value = null;
@@ -1640,7 +1640,7 @@ var _XfdfDocument = /** @class */ (function (_super) {
1640
1640
  this._document = document;
1641
1641
  this._crossReference = document._crossReference;
1642
1642
  this._isAnnotationExport = false;
1643
- var xml = _bytesToString(data);
1643
+ var xml = _bytesToString(data, true);
1644
1644
  this._xmlDocument = (new DOMParser()).parseFromString(xml, 'text/xml');
1645
1645
  this._isAnnotationImport = true;
1646
1646
  this._readXmlData(this._xmlDocument.documentElement);
@@ -1649,7 +1649,7 @@ var _XfdfDocument = /** @class */ (function (_super) {
1649
1649
  this._document = document;
1650
1650
  this._crossReference = document._crossReference;
1651
1651
  this._isAnnotationExport = false;
1652
- this._xmlDocument = (new DOMParser()).parseFromString(_bytesToString(data), 'text/xml');
1652
+ this._xmlDocument = (new DOMParser()).parseFromString(_bytesToString(data, true), 'text/xml');
1653
1653
  this._readXmlData(this._xmlDocument.documentElement);
1654
1654
  };
1655
1655
  _XfdfDocument.prototype._readXmlData = function (root) {
@@ -52,6 +52,7 @@ export declare class _PdfCrossReference {
52
52
  _writeFontDictionary(dictionary: _PdfDictionary): void;
53
53
  _writeStream(stream: _PdfBaseStream, buffer: Array<number>, transform?: _CipherTransform, isCrossReference?: boolean): void;
54
54
  _writeValue(value: any, buffer: Array<number>, transform?: _CipherTransform, isCrossReference?: boolean): void;
55
+ _writeUnicodeString(value: string, buffer: Array<number>): void;
55
56
  _writeString(value: string, buffer: Array<number>): void;
56
57
  _writeBytes(data: number[], buffer: Array<number>): void;
57
58
  _writeLong(value: number, count: number, buffer: Array<number>): void;
@@ -1,6 +1,6 @@
1
1
  import { _PdfStream } from './base-stream';
2
2
  import { _PdfDictionary, _PdfReferenceSet, _isCommand, _PdfReference, _PdfName } from './pdf-primitives';
3
- import { BaseException, FormatError, _escapePdfName, _bytesToString, ParserEndOfFileException, _numberToString, _stringToPdfString, _getSize } from './utils';
3
+ import { BaseException, FormatError, _escapePdfName, _bytesToString, ParserEndOfFileException, _numberToString, _stringToPdfString, _getSize, _stringToBigEndianBytes } from './utils';
4
4
  import { _PdfParser, _PdfLexicalOperator } from './pdf-parser';
5
5
  import { _PdfBaseStream } from './base-stream';
6
6
  import { PdfCrossReferenceType } from './enumerator';
@@ -979,7 +979,19 @@ var _PdfCrossReference = /** @class */ (function () {
979
979
  if (!isCrossReference && transform) {
980
980
  value = transform.encryptString(value);
981
981
  }
982
- this._writeString("(" + this._escapeString(value) + ")", buffer);
982
+ var isUnicode = false;
983
+ for (var i = 0; i < value.length; i++) {
984
+ if (value.charCodeAt([i]) > 255) {
985
+ isUnicode = true;
986
+ break;
987
+ }
988
+ }
989
+ if (isUnicode) {
990
+ this._writeUnicodeString(value, buffer);
991
+ }
992
+ else {
993
+ this._writeString("(" + this._escapeString(value) + ")", buffer);
994
+ }
983
995
  }
984
996
  else if (typeof value === 'number') {
985
997
  this._writeString(_numberToString(value), buffer);
@@ -997,6 +1009,37 @@ var _PdfCrossReference = /** @class */ (function () {
997
1009
  this._writeString('null', buffer);
998
1010
  }
999
1011
  };
1012
+ _PdfCrossReference.prototype._writeUnicodeString = function (value, buffer) {
1013
+ var byteValues = _stringToBigEndianBytes(value);
1014
+ byteValues.unshift(254, 255);
1015
+ var data = [];
1016
+ for (var i = 0; i < byteValues.length; i++) {
1017
+ var byte = byteValues[Number.parseInt(i.toString(), 10)];
1018
+ switch (byte) {
1019
+ case 40:
1020
+ case 41:
1021
+ data.push(92);
1022
+ data.push(byte);
1023
+ break;
1024
+ case 13:
1025
+ data.push(92);
1026
+ data.push(114);
1027
+ break;
1028
+ case 92:
1029
+ data.push(92);
1030
+ data.push(byte);
1031
+ break;
1032
+ default:
1033
+ data.push(byte);
1034
+ break;
1035
+ }
1036
+ }
1037
+ buffer.push('('.charCodeAt(0) & 0xff);
1038
+ for (var i = 0; i < data.length; i++) {
1039
+ buffer.push(data[Number.parseInt(i.toString(), 10)] & 0xff);
1040
+ }
1041
+ buffer.push(')'.charCodeAt(0) & 0xff);
1042
+ };
1000
1043
  _PdfCrossReference.prototype._writeString = function (value, buffer) {
1001
1044
  for (var i = 0; i < value.length; i++) {
1002
1045
  buffer.push(value.charCodeAt(i) & 0xff);
@@ -55,12 +55,12 @@ var _PdfEncryptor = /** @class */ (function () {
55
55
  if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
56
56
  throw new FormatError('invalid key length');
57
57
  }
58
- var ownerPassword = _stringToBytes(dictionary.get('O')).subarray(0, 32);
59
- var userPassword = _stringToBytes(dictionary.get('U')).subarray(0, 32);
58
+ var ownerPassword = _stringToBytes(dictionary.get('O'), false, true).subarray(0, 32);
59
+ var userPassword = _stringToBytes(dictionary.get('U'), false, true).subarray(0, 32);
60
60
  var flag = dictionary.get('P');
61
61
  var revision = dictionary.get('R');
62
62
  this._encryptMetaData = (algorithm === 4 || algorithm === 5) && dictionary.get('EncryptMetadata') !== false;
63
- var fileIdBytes = _stringToBytes(id);
63
+ var fileIdBytes = _stringToBytes(id, false, true);
64
64
  var passwordBytes;
65
65
  if (password) {
66
66
  if (revision === 6) {
@@ -83,15 +83,15 @@ var _PdfEncryptor = /** @class */ (function () {
83
83
  }
84
84
  }
85
85
  else {
86
- var ownerValidationKey = _stringToBytes(dictionary.get('O'));
86
+ var ownerValidationKey = _stringToBytes(dictionary.get('O'), false, true);
87
87
  var ownerValidationSalt = ownerValidationKey.subarray(32, 40);
88
88
  var ownerKeySalt = ownerValidationKey.subarray(40, 48);
89
- var userValidationKey = _stringToBytes(dictionary.get('U'));
89
+ var userValidationKey = _stringToBytes(dictionary.get('U'), false, true);
90
90
  var uBytes = userValidationKey.subarray(0, 48);
91
91
  var userValidationSalt = userValidationKey.subarray(32, 40);
92
92
  var userKeySalt = userValidationKey.subarray(40, 48);
93
- var ownerEncryption = _stringToBytes(dictionary.get('OE'));
94
- var userEncryption = _stringToBytes(dictionary.get('UE'));
93
+ var ownerEncryption = _stringToBytes(dictionary.get('OE'), false, true);
94
+ var userEncryption = _stringToBytes(dictionary.get('UE'), false, true);
95
95
  var algorithm_1;
96
96
  if (revision === 6) {
97
97
  algorithm_1 = new _AdvancedEncryption();
@@ -1590,7 +1590,7 @@ var _CipherTransform = /** @class */ (function () {
1590
1590
  return new _PdfDecryptStream(stream, length, this._streamCipher);
1591
1591
  };
1592
1592
  _CipherTransform.prototype.decryptString = function (s) {
1593
- return _bytesToString(this._stringCipher._decryptBlock(_stringToBytes(s), true));
1593
+ return _bytesToString(this._stringCipher._decryptBlock(_stringToBytes(s, false, true), true));
1594
1594
  };
1595
1595
  _CipherTransform.prototype.encryptString = function (s) {
1596
1596
  if (this._stringCipher instanceof _AdvancedEncryptionBaseCipher) {
@@ -1606,13 +1606,13 @@ var _CipherTransform = /** @class */ (function () {
1606
1606
  iv[Number.parseInt(i.toString(), 10)] = Math.floor(256 * Math.random());
1607
1607
  }
1608
1608
  }
1609
- var data = this._stringCipher._encrypt(_stringToBytes(s), iv);
1609
+ var data = this._stringCipher._encrypt(_stringToBytes(s, false, true), iv);
1610
1610
  var buffer = new Uint8Array(16 + data.length);
1611
1611
  buffer.set(iv);
1612
1612
  buffer.set(data, 16);
1613
1613
  return _bytesToString(buffer);
1614
1614
  }
1615
- return _bytesToString(this._stringCipher._encrypt(_stringToBytes(s)));
1615
+ return _bytesToString(this._stringCipher._encrypt(_stringToBytes(s, false, true)));
1616
1616
  };
1617
1617
  return _CipherTransform;
1618
1618
  }());
@@ -104,19 +104,11 @@ export declare function _stringToPdfString(value: string): string;
104
104
  *
105
105
  * @private
106
106
  * @param {string} value string value.
107
- * @param {boolean} isDirect Whether to return object or number[]. Default is false.
108
- * @returns {Uint8Array | number[]} Byte array
109
- */
110
- export declare function _stringToBytes(value: string, isDirect?: boolean): Uint8Array | number[];
111
- /**
112
- * Convert string value to byte array
113
- *
114
- * @private
115
- * @param {string} value string value.
116
- * @param {number[]} destination byte array.
117
- * @returns {number[]} Byte array
107
+ * @param {boolean} isDirect Whether to return a number[] or Uint8Array.
108
+ * @param {boolean} isPassword Whether the string is a password.
109
+ * @returns {number[] | Uint8Array} Byte array
118
110
  */
119
- export declare function _convertStringToBytes(value: string, destination: number[]): number[];
111
+ export declare function _stringToBytes(value: string, isDirect?: boolean, isPassword?: boolean, destination?: number[]): number[] | Uint8Array;
120
112
  /**
121
113
  * Check equal or not.
122
114
  *
@@ -150,7 +142,15 @@ export declare function _areNotEqual(value: number[], current: number[]): boolea
150
142
  * @param {Uint8Array} bytes Input data.
151
143
  * @returns {string} String value processed from input bytes.
152
144
  */
153
- export declare function _bytesToString(bytes: Uint8Array): string;
145
+ export declare function _bytesToString(bytes: Uint8Array, isJson?: boolean): string;
146
+ /**
147
+ * Decode unicode string.
148
+ *
149
+ * @private
150
+ * @param {Uint8Array} bytes Input data.
151
+ * @returns {string} String value processed from input bytes.
152
+ */
153
+ export declare function _decodeUTF8(bytes: Uint8Array): string;
154
154
  /**
155
155
  * Convert string to unicode array.
156
156
  *
@@ -765,3 +765,10 @@ export declare function _decodeText(text: string, isColorSpace: boolean, isPassw
765
765
  * @returns {number} number of bytes.
766
766
  */
767
767
  export declare function _getSize(input: number): number;
768
+ /**
769
+ * Convert the string to big endian bytes.
770
+ *
771
+ * @param {string} input string.
772
+ * @returns {number[]} bytes.
773
+ */
774
+ export declare function _stringToBigEndianBytes(input: string): number[];
@@ -270,30 +270,48 @@ export function _stringToPdfString(value) {
270
270
  *
271
271
  * @private
272
272
  * @param {string} value string value.
273
- * @param {boolean} isDirect Whether to return object or number[]. Default is false.
274
- * @returns {Uint8Array | number[]} Byte array
273
+ * @param {boolean} isDirect Whether to return a number[] or Uint8Array.
274
+ * @param {boolean} isPassword Whether the string is a password.
275
+ * @returns {number[] | Uint8Array} Byte array
275
276
  */
276
- export function _stringToBytes(value, isDirect) {
277
+ export function _stringToBytes(value, isDirect, isPassword, destination) {
277
278
  if (isDirect === void 0) { isDirect = false; }
279
+ if (isPassword === void 0) { isPassword = false; }
278
280
  var bytes = [];
279
- for (var i = 0; i < value.length; ++i) {
280
- bytes.push(value.charCodeAt(i) & 0xff);
281
+ if (destination) {
282
+ bytes = destination;
281
283
  }
282
- return isDirect ? bytes : new Uint8Array(bytes);
283
- }
284
- /**
285
- * Convert string value to byte array
286
- *
287
- * @private
288
- * @param {string} value string value.
289
- * @param {number[]} destination byte array.
290
- * @returns {number[]} Byte array
291
- */
292
- export function _convertStringToBytes(value, destination) {
293
- for (var i = 0; i < value.length; ++i) {
294
- destination.push(value.charCodeAt(i) & 0xff);
284
+ if (isPassword) {
285
+ for (var i = 0; i < value.length; i++) {
286
+ bytes.push(value.charCodeAt(i));
287
+ }
295
288
  }
296
- return destination;
289
+ else {
290
+ for (var i = 0; i < value.length; i++) {
291
+ var charCode = value.charCodeAt(i);
292
+ if (charCode < 0x80) {
293
+ bytes.push(charCode);
294
+ }
295
+ else if (charCode < 0x800) {
296
+ bytes.push((charCode >> 6) | 0xC0);
297
+ bytes.push((charCode & 0x3F) | 0x80);
298
+ }
299
+ else if (charCode < 0xD800 || charCode >= 0xE000) {
300
+ bytes.push((charCode >> 12) | 0xE0);
301
+ bytes.push(((charCode >> 6) & 0x3F) | 0x80);
302
+ bytes.push((charCode & 0x3F) | 0x80);
303
+ }
304
+ else {
305
+ i++;
306
+ charCode = 0x10000 + (((charCode & 0x3FF) << 10) | (value.charCodeAt(i) & 0x3FF));
307
+ bytes.push((charCode >> 18) | 0xF0);
308
+ bytes.push(((charCode >> 12) & 0x3F) | 0x80);
309
+ bytes.push(((charCode >> 6) & 0x3F) | 0x80);
310
+ bytes.push((charCode & 0x3F) | 0x80);
311
+ }
312
+ }
313
+ }
314
+ return isDirect ? bytes : new Uint8Array(bytes);
297
315
  }
298
316
  /**
299
317
  * Check equal or not.
@@ -355,20 +373,49 @@ export function _areNotEqual(value, current) {
355
373
  * @param {Uint8Array} bytes Input data.
356
374
  * @returns {string} String value processed from input bytes.
357
375
  */
358
- export function _bytesToString(bytes) {
376
+ export function _bytesToString(bytes, isJson) {
377
+ if (isJson === void 0) { isJson = false; }
359
378
  var length = bytes.length;
360
379
  var max = 8192;
380
+ var stringBuffer = [];
361
381
  if (length < max) {
362
- return String.fromCharCode.apply(null, bytes);
382
+ return (isJson ? _decodeUTF8(bytes) : String.fromCharCode.apply(null, bytes));
363
383
  }
364
- var stringBuffer = [];
365
384
  for (var i = 0; i < length; i += max) {
366
385
  var chunkEnd = Math.min(i + max, length);
367
386
  var chunk = bytes.subarray(i, chunkEnd);
368
- stringBuffer.push(String.fromCharCode.apply(null, chunk));
387
+ stringBuffer.push(isJson ? _decodeUTF8(chunk) : String.fromCharCode.apply(null, chunk));
369
388
  }
370
389
  return stringBuffer.join('');
371
390
  }
391
+ /**
392
+ * Decode unicode string.
393
+ *
394
+ * @private
395
+ * @param {Uint8Array} bytes Input data.
396
+ * @returns {string} String value processed from input bytes.
397
+ */
398
+ export function _decodeUTF8(bytes) {
399
+ var result = '';
400
+ var i = 0;
401
+ while (i < bytes.length) {
402
+ var byte = bytes[i++];
403
+ if (byte < 0x80) {
404
+ result += String.fromCharCode(byte);
405
+ }
406
+ else if (byte < 0xE0) {
407
+ result += String.fromCharCode(((byte & 0x1F) << 6) | (bytes[i++] & 0x3F));
408
+ }
409
+ else if (byte < 0xF0) {
410
+ result += String.fromCharCode(((byte & 0x0F) << 12) | ((bytes[i++] & 0x3F) << 6) | (bytes[i++] & 0x3F));
411
+ }
412
+ else {
413
+ var codePoint = ((byte & 0x07) << 18) | ((bytes[i++] & 0x3F) << 12) | ((bytes[i++] & 0x3F) << 6) | (bytes[i++] & 0x3F) - 0x10000;
414
+ result += String.fromCharCode((codePoint >> 10) + 0xD800, (codePoint & 0x03FF) + 0xDC00);
415
+ }
416
+ }
417
+ return result;
418
+ }
372
419
  /**
373
420
  * Convert string to unicode array.
374
421
  *
@@ -3991,3 +4038,20 @@ export function _getSize(input) {
3991
4038
  }
3992
4039
  return size;
3993
4040
  }
4041
+ /**
4042
+ * Convert the string to big endian bytes.
4043
+ *
4044
+ * @param {string} input string.
4045
+ * @returns {number[]} bytes.
4046
+ */
4047
+ export function _stringToBigEndianBytes(input) {
4048
+ var bytes = [];
4049
+ for (var i = 0; i < input.length; i++) {
4050
+ var charCode = input.charCodeAt(Number.parseInt(i.toString(), 10));
4051
+ if (charCode <= 0xFFFF) {
4052
+ bytes.push((charCode >> 8) & 0xFF);
4053
+ bytes.push(charCode & 0xFF);
4054
+ }
4055
+ }
4056
+ return bytes;
4057
+ }