@gct-paas/core 0.1.4-dev.3 → 0.1.4-dev.4

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.
Files changed (122) hide show
  1. package/dist/index.min.cjs +1 -1
  2. package/dist/index.system.min.js +1 -1
  3. package/es/controller/form/form.controller.mjs +1 -2
  4. package/es/controller/gct-form/gct-form.controller.mjs +1 -2
  5. package/es/global/gct/gct.d.ts +1 -1
  6. package/es/interface/controller/form/form.controller.mjs +1 -1
  7. package/es/interface/hooks/i-designer-hooks.mjs +1 -1
  8. package/es/interface/i-modal/i-modal.mjs +1 -1
  9. package/es/modules/api-service/api-manage.mjs +1 -1
  10. package/es/modules/api-service/api-service.interface.d.ts +2 -2
  11. package/es/modules/api-service/api-service.interface.mjs +2 -2
  12. package/es/modules/api-service/api-service.mjs +1 -1
  13. package/es/modules/api-service/index.mjs +2 -4
  14. package/es/modules/env-manager/env-manager.d.ts +1 -1
  15. package/es/modules/env-manager/env-manager.interface.d.ts +1 -1
  16. package/es/modules/platform-config/useBasicSetting.d.ts +2 -2
  17. package/es/modules/platform-config/useDeploySetting.d.ts +1 -1
  18. package/es/modules/platform-config/useLoginSetting.d.ts +1 -1
  19. package/es/modules/platform-config/useOrgSetting.d.ts +1 -1
  20. package/es/modules/platform-config/useSecuritySetting.d.ts +1 -1
  21. package/es/modules/platform-config/useThemeSetting.d.ts +1 -1
  22. package/es/modules/platform-config/useWatermarkSetting.d.ts +1 -1
  23. package/es/register/designer-register/designer-register.mjs +1 -2
  24. package/es/register/render-register/render-register.mjs +1 -2
  25. package/es/store/global-store.mjs +1 -1
  26. package/es/types/index.d.ts +2 -2
  27. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +1 -1
  28. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +1 -1
  29. package/es/utils/tools/tools.mjs +1 -2
  30. package/package.json +6 -8
  31. package/es/_virtual/_commonjs-dynamic-modules.mjs +0 -5
  32. package/es/_virtual/_commonjsHelpers.mjs +0 -44
  33. package/es/_virtual/aes.mjs +0 -3
  34. package/es/_virtual/blowfish.mjs +0 -3
  35. package/es/_virtual/cipher-core.mjs +0 -3
  36. package/es/_virtual/core.mjs +0 -3
  37. package/es/_virtual/enc-base64.mjs +0 -3
  38. package/es/_virtual/enc-base64url.mjs +0 -3
  39. package/es/_virtual/enc-utf16.mjs +0 -3
  40. package/es/_virtual/evpkdf.mjs +0 -3
  41. package/es/_virtual/format-hex.mjs +0 -3
  42. package/es/_virtual/hmac.mjs +0 -3
  43. package/es/_virtual/index.mjs +0 -7
  44. package/es/_virtual/index2.mjs +0 -7
  45. package/es/_virtual/index3.mjs +0 -3
  46. package/es/_virtual/lib-typedarrays.mjs +0 -3
  47. package/es/_virtual/md5.mjs +0 -3
  48. package/es/_virtual/mode-cfb.mjs +0 -3
  49. package/es/_virtual/mode-ctr-gladman.mjs +0 -3
  50. package/es/_virtual/mode-ctr.mjs +0 -3
  51. package/es/_virtual/mode-ecb.mjs +0 -3
  52. package/es/_virtual/mode-ofb.mjs +0 -3
  53. package/es/_virtual/pad-ansix923.mjs +0 -3
  54. package/es/_virtual/pad-iso10126.mjs +0 -3
  55. package/es/_virtual/pad-iso97971.mjs +0 -3
  56. package/es/_virtual/pad-nopadding.mjs +0 -3
  57. package/es/_virtual/pad-zeropadding.mjs +0 -3
  58. package/es/_virtual/pbkdf2.mjs +0 -3
  59. package/es/_virtual/rabbit-legacy.mjs +0 -3
  60. package/es/_virtual/rabbit.mjs +0 -3
  61. package/es/_virtual/rc4.mjs +0 -3
  62. package/es/_virtual/ripemd160.mjs +0 -3
  63. package/es/_virtual/sha1.mjs +0 -3
  64. package/es/_virtual/sha224.mjs +0 -3
  65. package/es/_virtual/sha256.mjs +0 -3
  66. package/es/_virtual/sha3.mjs +0 -3
  67. package/es/_virtual/sha384.mjs +0 -3
  68. package/es/_virtual/sha512.mjs +0 -3
  69. package/es/_virtual/tripledes.mjs +0 -3
  70. package/es/_virtual/x64-core.mjs +0 -3
  71. package/es/node_modules/.pnpm/@gct-paas_api-apaas@0.0.2-dev.4/node_modules/@gct-paas/api-apaas/es/index.mjs +0 -3
  72. package/es/node_modules/.pnpm/@gct-paas_api-apaas@0.0.2-dev.4/node_modules/@gct-paas/api-apaas/es/service/api-config.mjs +0 -8213
  73. package/es/node_modules/.pnpm/@gct-paas_api-platform@0.0.2-dev.4/node_modules/@gct-paas/api-platform/es/index.mjs +0 -3
  74. package/es/node_modules/.pnpm/@gct-paas_api-platform@0.0.2-dev.4/node_modules/@gct-paas/api-platform/es/service/api-config.mjs +0 -7156
  75. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.mjs +0 -255
  76. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/blowfish.mjs +0 -492
  77. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/cipher-core.mjs +0 -913
  78. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.mjs +0 -824
  79. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64.mjs +0 -153
  80. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-base64url.mjs +0 -165
  81. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf16.mjs +0 -166
  82. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/evpkdf.mjs +0 -153
  83. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/format-hex.mjs +0 -84
  84. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/hmac.mjs +0 -160
  85. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/index.mjs +0 -69
  86. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/lib-typedarrays.mjs +0 -93
  87. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/md5.mjs +0 -285
  88. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-cfb.mjs +0 -98
  89. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr-gladman.mjs +0 -134
  90. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ctr.mjs +0 -76
  91. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.mjs +0 -58
  92. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ofb.mjs +0 -72
  93. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-ansix923.mjs +0 -67
  94. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso10126.mjs +0 -62
  95. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-iso97971.mjs +0 -58
  96. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-nopadding.mjs +0 -48
  97. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-zeropadding.mjs +0 -65
  98. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pbkdf2.mjs +0 -164
  99. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit-legacy.mjs +0 -211
  100. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rabbit.mjs +0 -213
  101. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/rc4.mjs +0 -160
  102. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/ripemd160.mjs +0 -284
  103. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha1.mjs +0 -167
  104. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha224.mjs +0 -98
  105. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha256.mjs +0 -216
  106. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha3.mjs +0 -344
  107. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha384.mjs +0 -102
  108. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/sha512.mjs +0 -344
  109. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/tripledes.mjs +0 -800
  110. package/es/node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/x64-core.mjs +0 -321
  111. package/es/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.mjs +0 -541
  112. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/async-series-hook/async-series-hook.mjs +0 -73
  113. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/index.mjs +0 -2
  114. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/hook/sync-series-hook/sync-series-hook.mjs +0 -100
  115. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/index.mjs +0 -2
  116. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/array/array.mjs +0 -47
  117. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/index.mjs +0 -5
  118. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/object/object.mjs +0 -24
  119. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event/qx-event.mjs +0 -94
  120. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/qx-event-emitter/qx-event-emitter.mjs +0 -146
  121. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/type-util/type-util.mjs +0 -149
  122. package/es/node_modules/.pnpm/qx-util@0.4.8/node_modules/qx-util/out/utils/util/util.mjs +0 -227
@@ -1,824 +0,0 @@
1
- import { commonjsGlobal } from '../../../../../_virtual/_commonjsHelpers.mjs';
2
- import { commonjsRequire } from '../../../../../_virtual/_commonjs-dynamic-modules.mjs';
3
- import { __module as core$1 } from '../../../../../_virtual/core.mjs';
4
-
5
- var core = core$1.exports;
6
-
7
- var hasRequiredCore;
8
-
9
- function requireCore () {
10
- if (hasRequiredCore) return core$1.exports;
11
- hasRequiredCore = 1;
12
- (function (module, exports) {
13
- ;(function (root, factory) {
14
- if ('object' === "object") {
15
- // CommonJS
16
- module.exports = exports = factory();
17
- }
18
- else if (typeof undefined === "function" && undefined.amd) {
19
- // AMD
20
- undefined([], factory);
21
- }
22
- else {
23
- // Global (browser)
24
- root.CryptoJS = factory();
25
- }
26
- }(core, function () {
27
-
28
- /*globals window, global, require*/
29
-
30
- /**
31
- * CryptoJS core components.
32
- */
33
- var CryptoJS = CryptoJS || (function (Math, undefined$1) {
34
-
35
- var crypto;
36
-
37
- // Native crypto from window (Browser)
38
- if (typeof window !== 'undefined' && window.crypto) {
39
- crypto = window.crypto;
40
- }
41
-
42
- // Native crypto in web worker (Browser)
43
- if (typeof self !== 'undefined' && self.crypto) {
44
- crypto = self.crypto;
45
- }
46
-
47
- // Native crypto from worker
48
- if (typeof globalThis !== 'undefined' && globalThis.crypto) {
49
- crypto = globalThis.crypto;
50
- }
51
-
52
- // Native (experimental IE 11) crypto from window (Browser)
53
- if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
54
- crypto = window.msCrypto;
55
- }
56
-
57
- // Native crypto from global (NodeJS)
58
- if (!crypto && typeof commonjsGlobal !== 'undefined' && commonjsGlobal.crypto) {
59
- crypto = commonjsGlobal.crypto;
60
- }
61
-
62
- // Native crypto import via require (NodeJS)
63
- if (!crypto && typeof commonjsRequire === 'function') {
64
- try {
65
- crypto = require('crypto');
66
- } catch (err) {}
67
- }
68
-
69
- /*
70
- * Cryptographically secure pseudorandom number generator
71
- *
72
- * As Math.random() is cryptographically not safe to use
73
- */
74
- var cryptoSecureRandomInt = function () {
75
- if (crypto) {
76
- // Use getRandomValues method (Browser)
77
- if (typeof crypto.getRandomValues === 'function') {
78
- try {
79
- return crypto.getRandomValues(new Uint32Array(1))[0];
80
- } catch (err) {}
81
- }
82
-
83
- // Use randomBytes method (NodeJS)
84
- if (typeof crypto.randomBytes === 'function') {
85
- try {
86
- return crypto.randomBytes(4).readInt32LE();
87
- } catch (err) {}
88
- }
89
- }
90
-
91
- throw new Error('Native crypto module could not be used to get secure random number.');
92
- };
93
-
94
- /*
95
- * Local polyfill of Object.create
96
-
97
- */
98
- var create = Object.create || (function () {
99
- function F() {}
100
-
101
- return function (obj) {
102
- var subtype;
103
-
104
- F.prototype = obj;
105
-
106
- subtype = new F();
107
-
108
- F.prototype = null;
109
-
110
- return subtype;
111
- };
112
- }());
113
-
114
- /**
115
- * CryptoJS namespace.
116
- */
117
- var C = {};
118
-
119
- /**
120
- * Library namespace.
121
- */
122
- var C_lib = C.lib = {};
123
-
124
- /**
125
- * Base object for prototypal inheritance.
126
- */
127
- var Base = C_lib.Base = (function () {
128
-
129
-
130
- return {
131
- /**
132
- * Creates a new object that inherits from this object.
133
- *
134
- * @param {Object} overrides Properties to copy into the new object.
135
- *
136
- * @return {Object} The new object.
137
- *
138
- * @static
139
- *
140
- * @example
141
- *
142
- * var MyType = CryptoJS.lib.Base.extend({
143
- * field: 'value',
144
- *
145
- * method: function () {
146
- * }
147
- * });
148
- */
149
- extend: function (overrides) {
150
- // Spawn
151
- var subtype = create(this);
152
-
153
- // Augment
154
- if (overrides) {
155
- subtype.mixIn(overrides);
156
- }
157
-
158
- // Create default initializer
159
- if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
160
- subtype.init = function () {
161
- subtype.$super.init.apply(this, arguments);
162
- };
163
- }
164
-
165
- // Initializer's prototype is the subtype object
166
- subtype.init.prototype = subtype;
167
-
168
- // Reference supertype
169
- subtype.$super = this;
170
-
171
- return subtype;
172
- },
173
-
174
- /**
175
- * Extends this object and runs the init method.
176
- * Arguments to create() will be passed to init().
177
- *
178
- * @return {Object} The new object.
179
- *
180
- * @static
181
- *
182
- * @example
183
- *
184
- * var instance = MyType.create();
185
- */
186
- create: function () {
187
- var instance = this.extend();
188
- instance.init.apply(instance, arguments);
189
-
190
- return instance;
191
- },
192
-
193
- /**
194
- * Initializes a newly created object.
195
- * Override this method to add some logic when your objects are created.
196
- *
197
- * @example
198
- *
199
- * var MyType = CryptoJS.lib.Base.extend({
200
- * init: function () {
201
- * // ...
202
- * }
203
- * });
204
- */
205
- init: function () {
206
- },
207
-
208
- /**
209
- * Copies properties into this object.
210
- *
211
- * @param {Object} properties The properties to mix in.
212
- *
213
- * @example
214
- *
215
- * MyType.mixIn({
216
- * field: 'value'
217
- * });
218
- */
219
- mixIn: function (properties) {
220
- for (var propertyName in properties) {
221
- if (properties.hasOwnProperty(propertyName)) {
222
- this[propertyName] = properties[propertyName];
223
- }
224
- }
225
-
226
- // IE won't copy toString using the loop above
227
- if (properties.hasOwnProperty('toString')) {
228
- this.toString = properties.toString;
229
- }
230
- },
231
-
232
- /**
233
- * Creates a copy of this object.
234
- *
235
- * @return {Object} The clone.
236
- *
237
- * @example
238
- *
239
- * var clone = instance.clone();
240
- */
241
- clone: function () {
242
- return this.init.prototype.extend(this);
243
- }
244
- };
245
- }());
246
-
247
- /**
248
- * An array of 32-bit words.
249
- *
250
- * @property {Array} words The array of 32-bit words.
251
- * @property {number} sigBytes The number of significant bytes in this word array.
252
- */
253
- var WordArray = C_lib.WordArray = Base.extend({
254
- /**
255
- * Initializes a newly created word array.
256
- *
257
- * @param {Array} words (Optional) An array of 32-bit words.
258
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
259
- *
260
- * @example
261
- *
262
- * var wordArray = CryptoJS.lib.WordArray.create();
263
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
264
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
265
- */
266
- init: function (words, sigBytes) {
267
- words = this.words = words || [];
268
-
269
- if (sigBytes != undefined$1) {
270
- this.sigBytes = sigBytes;
271
- } else {
272
- this.sigBytes = words.length * 4;
273
- }
274
- },
275
-
276
- /**
277
- * Converts this word array to a string.
278
- *
279
- * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
280
- *
281
- * @return {string} The stringified word array.
282
- *
283
- * @example
284
- *
285
- * var string = wordArray + '';
286
- * var string = wordArray.toString();
287
- * var string = wordArray.toString(CryptoJS.enc.Utf8);
288
- */
289
- toString: function (encoder) {
290
- return (encoder || Hex).stringify(this);
291
- },
292
-
293
- /**
294
- * Concatenates a word array to this word array.
295
- *
296
- * @param {WordArray} wordArray The word array to append.
297
- *
298
- * @return {WordArray} This word array.
299
- *
300
- * @example
301
- *
302
- * wordArray1.concat(wordArray2);
303
- */
304
- concat: function (wordArray) {
305
- // Shortcuts
306
- var thisWords = this.words;
307
- var thatWords = wordArray.words;
308
- var thisSigBytes = this.sigBytes;
309
- var thatSigBytes = wordArray.sigBytes;
310
-
311
- // Clamp excess bits
312
- this.clamp();
313
-
314
- // Concat
315
- if (thisSigBytes % 4) {
316
- // Copy one byte at a time
317
- for (var i = 0; i < thatSigBytes; i++) {
318
- var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
319
- thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
320
- }
321
- } else {
322
- // Copy one word at a time
323
- for (var j = 0; j < thatSigBytes; j += 4) {
324
- thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];
325
- }
326
- }
327
- this.sigBytes += thatSigBytes;
328
-
329
- // Chainable
330
- return this;
331
- },
332
-
333
- /**
334
- * Removes insignificant bits.
335
- *
336
- * @example
337
- *
338
- * wordArray.clamp();
339
- */
340
- clamp: function () {
341
- // Shortcuts
342
- var words = this.words;
343
- var sigBytes = this.sigBytes;
344
-
345
- // Clamp
346
- words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
347
- words.length = Math.ceil(sigBytes / 4);
348
- },
349
-
350
- /**
351
- * Creates a copy of this word array.
352
- *
353
- * @return {WordArray} The clone.
354
- *
355
- * @example
356
- *
357
- * var clone = wordArray.clone();
358
- */
359
- clone: function () {
360
- var clone = Base.clone.call(this);
361
- clone.words = this.words.slice(0);
362
-
363
- return clone;
364
- },
365
-
366
- /**
367
- * Creates a word array filled with random bytes.
368
- *
369
- * @param {number} nBytes The number of random bytes to generate.
370
- *
371
- * @return {WordArray} The random word array.
372
- *
373
- * @static
374
- *
375
- * @example
376
- *
377
- * var wordArray = CryptoJS.lib.WordArray.random(16);
378
- */
379
- random: function (nBytes) {
380
- var words = [];
381
-
382
- for (var i = 0; i < nBytes; i += 4) {
383
- words.push(cryptoSecureRandomInt());
384
- }
385
-
386
- return new WordArray.init(words, nBytes);
387
- }
388
- });
389
-
390
- /**
391
- * Encoder namespace.
392
- */
393
- var C_enc = C.enc = {};
394
-
395
- /**
396
- * Hex encoding strategy.
397
- */
398
- var Hex = C_enc.Hex = {
399
- /**
400
- * Converts a word array to a hex string.
401
- *
402
- * @param {WordArray} wordArray The word array.
403
- *
404
- * @return {string} The hex string.
405
- *
406
- * @static
407
- *
408
- * @example
409
- *
410
- * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
411
- */
412
- stringify: function (wordArray) {
413
- // Shortcuts
414
- var words = wordArray.words;
415
- var sigBytes = wordArray.sigBytes;
416
-
417
- // Convert
418
- var hexChars = [];
419
- for (var i = 0; i < sigBytes; i++) {
420
- var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
421
- hexChars.push((bite >>> 4).toString(16));
422
- hexChars.push((bite & 0x0f).toString(16));
423
- }
424
-
425
- return hexChars.join('');
426
- },
427
-
428
- /**
429
- * Converts a hex string to a word array.
430
- *
431
- * @param {string} hexStr The hex string.
432
- *
433
- * @return {WordArray} The word array.
434
- *
435
- * @static
436
- *
437
- * @example
438
- *
439
- * var wordArray = CryptoJS.enc.Hex.parse(hexString);
440
- */
441
- parse: function (hexStr) {
442
- // Shortcut
443
- var hexStrLength = hexStr.length;
444
-
445
- // Convert
446
- var words = [];
447
- for (var i = 0; i < hexStrLength; i += 2) {
448
- words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
449
- }
450
-
451
- return new WordArray.init(words, hexStrLength / 2);
452
- }
453
- };
454
-
455
- /**
456
- * Latin1 encoding strategy.
457
- */
458
- var Latin1 = C_enc.Latin1 = {
459
- /**
460
- * Converts a word array to a Latin1 string.
461
- *
462
- * @param {WordArray} wordArray The word array.
463
- *
464
- * @return {string} The Latin1 string.
465
- *
466
- * @static
467
- *
468
- * @example
469
- *
470
- * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
471
- */
472
- stringify: function (wordArray) {
473
- // Shortcuts
474
- var words = wordArray.words;
475
- var sigBytes = wordArray.sigBytes;
476
-
477
- // Convert
478
- var latin1Chars = [];
479
- for (var i = 0; i < sigBytes; i++) {
480
- var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
481
- latin1Chars.push(String.fromCharCode(bite));
482
- }
483
-
484
- return latin1Chars.join('');
485
- },
486
-
487
- /**
488
- * Converts a Latin1 string to a word array.
489
- *
490
- * @param {string} latin1Str The Latin1 string.
491
- *
492
- * @return {WordArray} The word array.
493
- *
494
- * @static
495
- *
496
- * @example
497
- *
498
- * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
499
- */
500
- parse: function (latin1Str) {
501
- // Shortcut
502
- var latin1StrLength = latin1Str.length;
503
-
504
- // Convert
505
- var words = [];
506
- for (var i = 0; i < latin1StrLength; i++) {
507
- words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
508
- }
509
-
510
- return new WordArray.init(words, latin1StrLength);
511
- }
512
- };
513
-
514
- /**
515
- * UTF-8 encoding strategy.
516
- */
517
- var Utf8 = C_enc.Utf8 = {
518
- /**
519
- * Converts a word array to a UTF-8 string.
520
- *
521
- * @param {WordArray} wordArray The word array.
522
- *
523
- * @return {string} The UTF-8 string.
524
- *
525
- * @static
526
- *
527
- * @example
528
- *
529
- * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
530
- */
531
- stringify: function (wordArray) {
532
- try {
533
- return decodeURIComponent(escape(Latin1.stringify(wordArray)));
534
- } catch (e) {
535
- throw new Error('Malformed UTF-8 data');
536
- }
537
- },
538
-
539
- /**
540
- * Converts a UTF-8 string to a word array.
541
- *
542
- * @param {string} utf8Str The UTF-8 string.
543
- *
544
- * @return {WordArray} The word array.
545
- *
546
- * @static
547
- *
548
- * @example
549
- *
550
- * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
551
- */
552
- parse: function (utf8Str) {
553
- return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
554
- }
555
- };
556
-
557
- /**
558
- * Abstract buffered block algorithm template.
559
- *
560
- * The property blockSize must be implemented in a concrete subtype.
561
- *
562
- * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
563
- */
564
- var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
565
- /**
566
- * Resets this block algorithm's data buffer to its initial state.
567
- *
568
- * @example
569
- *
570
- * bufferedBlockAlgorithm.reset();
571
- */
572
- reset: function () {
573
- // Initial values
574
- this._data = new WordArray.init();
575
- this._nDataBytes = 0;
576
- },
577
-
578
- /**
579
- * Adds new data to this block algorithm's buffer.
580
- *
581
- * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
582
- *
583
- * @example
584
- *
585
- * bufferedBlockAlgorithm._append('data');
586
- * bufferedBlockAlgorithm._append(wordArray);
587
- */
588
- _append: function (data) {
589
- // Convert string to WordArray, else assume WordArray already
590
- if (typeof data == 'string') {
591
- data = Utf8.parse(data);
592
- }
593
-
594
- // Append
595
- this._data.concat(data);
596
- this._nDataBytes += data.sigBytes;
597
- },
598
-
599
- /**
600
- * Processes available data blocks.
601
- *
602
- * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
603
- *
604
- * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
605
- *
606
- * @return {WordArray} The processed data.
607
- *
608
- * @example
609
- *
610
- * var processedData = bufferedBlockAlgorithm._process();
611
- * var processedData = bufferedBlockAlgorithm._process(!!'flush');
612
- */
613
- _process: function (doFlush) {
614
- var processedWords;
615
-
616
- // Shortcuts
617
- var data = this._data;
618
- var dataWords = data.words;
619
- var dataSigBytes = data.sigBytes;
620
- var blockSize = this.blockSize;
621
- var blockSizeBytes = blockSize * 4;
622
-
623
- // Count blocks ready
624
- var nBlocksReady = dataSigBytes / blockSizeBytes;
625
- if (doFlush) {
626
- // Round up to include partial blocks
627
- nBlocksReady = Math.ceil(nBlocksReady);
628
- } else {
629
- // Round down to include only full blocks,
630
- // less the number of blocks that must remain in the buffer
631
- nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
632
- }
633
-
634
- // Count words ready
635
- var nWordsReady = nBlocksReady * blockSize;
636
-
637
- // Count bytes ready
638
- var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
639
-
640
- // Process blocks
641
- if (nWordsReady) {
642
- for (var offset = 0; offset < nWordsReady; offset += blockSize) {
643
- // Perform concrete-algorithm logic
644
- this._doProcessBlock(dataWords, offset);
645
- }
646
-
647
- // Remove processed words
648
- processedWords = dataWords.splice(0, nWordsReady);
649
- data.sigBytes -= nBytesReady;
650
- }
651
-
652
- // Return processed words
653
- return new WordArray.init(processedWords, nBytesReady);
654
- },
655
-
656
- /**
657
- * Creates a copy of this object.
658
- *
659
- * @return {Object} The clone.
660
- *
661
- * @example
662
- *
663
- * var clone = bufferedBlockAlgorithm.clone();
664
- */
665
- clone: function () {
666
- var clone = Base.clone.call(this);
667
- clone._data = this._data.clone();
668
-
669
- return clone;
670
- },
671
-
672
- _minBufferSize: 0
673
- });
674
-
675
- /**
676
- * Abstract hasher template.
677
- *
678
- * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
679
- */
680
- var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
681
- /**
682
- * Configuration options.
683
- */
684
- cfg: Base.extend(),
685
-
686
- /**
687
- * Initializes a newly created hasher.
688
- *
689
- * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
690
- *
691
- * @example
692
- *
693
- * var hasher = CryptoJS.algo.SHA256.create();
694
- */
695
- init: function (cfg) {
696
- // Apply config defaults
697
- this.cfg = this.cfg.extend(cfg);
698
-
699
- // Set initial values
700
- this.reset();
701
- },
702
-
703
- /**
704
- * Resets this hasher to its initial state.
705
- *
706
- * @example
707
- *
708
- * hasher.reset();
709
- */
710
- reset: function () {
711
- // Reset data buffer
712
- BufferedBlockAlgorithm.reset.call(this);
713
-
714
- // Perform concrete-hasher logic
715
- this._doReset();
716
- },
717
-
718
- /**
719
- * Updates this hasher with a message.
720
- *
721
- * @param {WordArray|string} messageUpdate The message to append.
722
- *
723
- * @return {Hasher} This hasher.
724
- *
725
- * @example
726
- *
727
- * hasher.update('message');
728
- * hasher.update(wordArray);
729
- */
730
- update: function (messageUpdate) {
731
- // Append
732
- this._append(messageUpdate);
733
-
734
- // Update the hash
735
- this._process();
736
-
737
- // Chainable
738
- return this;
739
- },
740
-
741
- /**
742
- * Finalizes the hash computation.
743
- * Note that the finalize operation is effectively a destructive, read-once operation.
744
- *
745
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
746
- *
747
- * @return {WordArray} The hash.
748
- *
749
- * @example
750
- *
751
- * var hash = hasher.finalize();
752
- * var hash = hasher.finalize('message');
753
- * var hash = hasher.finalize(wordArray);
754
- */
755
- finalize: function (messageUpdate) {
756
- // Final message update
757
- if (messageUpdate) {
758
- this._append(messageUpdate);
759
- }
760
-
761
- // Perform concrete-hasher logic
762
- var hash = this._doFinalize();
763
-
764
- return hash;
765
- },
766
-
767
- blockSize: 512/32,
768
-
769
- /**
770
- * Creates a shortcut function to a hasher's object interface.
771
- *
772
- * @param {Hasher} hasher The hasher to create a helper for.
773
- *
774
- * @return {Function} The shortcut function.
775
- *
776
- * @static
777
- *
778
- * @example
779
- *
780
- * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
781
- */
782
- _createHelper: function (hasher) {
783
- return function (message, cfg) {
784
- return new hasher.init(cfg).finalize(message);
785
- };
786
- },
787
-
788
- /**
789
- * Creates a shortcut function to the HMAC's object interface.
790
- *
791
- * @param {Hasher} hasher The hasher to use in this HMAC helper.
792
- *
793
- * @return {Function} The shortcut function.
794
- *
795
- * @static
796
- *
797
- * @example
798
- *
799
- * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
800
- */
801
- _createHmacHelper: function (hasher) {
802
- return function (message, key) {
803
- return new C_algo.HMAC.init(hasher, key).finalize(message);
804
- };
805
- }
806
- });
807
-
808
- /**
809
- * Algorithm namespace.
810
- */
811
- var C_algo = C.algo = {};
812
-
813
- return C;
814
- }(Math));
815
-
816
-
817
- return CryptoJS;
818
-
819
- }));
820
- } (core$1, core$1.exports));
821
- return core$1.exports;
822
- }
823
-
824
- export { requireCore as __require };