1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | (function (factory) {
|
---|
9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
10 | var v = factory(require, exports);
|
---|
11 | if (v !== undefined) module.exports = v;
|
---|
12 | }
|
---|
13 | else if (typeof define === "function" && define.amd) {
|
---|
14 | define("@angular/compiler/src/i18n/digest", ["require", "exports", "tslib", "@angular/compiler/src/util", "@angular/compiler/src/i18n/big_integer"], factory);
|
---|
15 | }
|
---|
16 | })(function (require, exports) {
|
---|
17 | "use strict";
|
---|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
19 | exports.computeMsgId = exports.fingerprint = exports.sha1 = exports.serializeNodes = exports.computeDecimalDigest = exports.decimalDigest = exports.computeDigest = exports.digest = void 0;
|
---|
20 | var tslib_1 = require("tslib");
|
---|
21 | var util_1 = require("@angular/compiler/src/util");
|
---|
22 | var big_integer_1 = require("@angular/compiler/src/i18n/big_integer");
|
---|
23 | /**
|
---|
24 | * Return the message id or compute it using the XLIFF1 digest.
|
---|
25 | */
|
---|
26 | function digest(message) {
|
---|
27 | return message.id || computeDigest(message);
|
---|
28 | }
|
---|
29 | exports.digest = digest;
|
---|
30 | /**
|
---|
31 | * Compute the message id using the XLIFF1 digest.
|
---|
32 | */
|
---|
33 | function computeDigest(message) {
|
---|
34 | return sha1(serializeNodes(message.nodes).join('') + ("[" + message.meaning + "]"));
|
---|
35 | }
|
---|
36 | exports.computeDigest = computeDigest;
|
---|
37 | /**
|
---|
38 | * Return the message id or compute it using the XLIFF2/XMB/$localize digest.
|
---|
39 | */
|
---|
40 | function decimalDigest(message) {
|
---|
41 | return message.id || computeDecimalDigest(message);
|
---|
42 | }
|
---|
43 | exports.decimalDigest = decimalDigest;
|
---|
44 | /**
|
---|
45 | * Compute the message id using the XLIFF2/XMB/$localize digest.
|
---|
46 | */
|
---|
47 | function computeDecimalDigest(message) {
|
---|
48 | var visitor = new _SerializerIgnoreIcuExpVisitor();
|
---|
49 | var parts = message.nodes.map(function (a) { return a.visit(visitor, null); });
|
---|
50 | return computeMsgId(parts.join(''), message.meaning);
|
---|
51 | }
|
---|
52 | exports.computeDecimalDigest = computeDecimalDigest;
|
---|
53 | /**
|
---|
54 | * Serialize the i18n ast to something xml-like in order to generate an UID.
|
---|
55 | *
|
---|
56 | * The visitor is also used in the i18n parser tests
|
---|
57 | *
|
---|
58 | * @internal
|
---|
59 | */
|
---|
60 | var _SerializerVisitor = /** @class */ (function () {
|
---|
61 | function _SerializerVisitor() {
|
---|
62 | }
|
---|
63 | _SerializerVisitor.prototype.visitText = function (text, context) {
|
---|
64 | return text.value;
|
---|
65 | };
|
---|
66 | _SerializerVisitor.prototype.visitContainer = function (container, context) {
|
---|
67 | var _this = this;
|
---|
68 | return "[" + container.children.map(function (child) { return child.visit(_this); }).join(', ') + "]";
|
---|
69 | };
|
---|
70 | _SerializerVisitor.prototype.visitIcu = function (icu, context) {
|
---|
71 | var _this = this;
|
---|
72 | var strCases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
|
---|
73 | return "{" + icu.expression + ", " + icu.type + ", " + strCases.join(', ') + "}";
|
---|
74 | };
|
---|
75 | _SerializerVisitor.prototype.visitTagPlaceholder = function (ph, context) {
|
---|
76 | var _this = this;
|
---|
77 | return ph.isVoid ?
|
---|
78 | "<ph tag name=\"" + ph.startName + "\"/>" :
|
---|
79 | "<ph tag name=\"" + ph.startName + "\">" + ph.children.map(function (child) { return child.visit(_this); }).join(', ') + "</ph name=\"" + ph.closeName + "\">";
|
---|
80 | };
|
---|
81 | _SerializerVisitor.prototype.visitPlaceholder = function (ph, context) {
|
---|
82 | return ph.value ? "<ph name=\"" + ph.name + "\">" + ph.value + "</ph>" : "<ph name=\"" + ph.name + "\"/>";
|
---|
83 | };
|
---|
84 | _SerializerVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
|
---|
85 | return "<ph icu name=\"" + ph.name + "\">" + ph.value.visit(this) + "</ph>";
|
---|
86 | };
|
---|
87 | return _SerializerVisitor;
|
---|
88 | }());
|
---|
89 | var serializerVisitor = new _SerializerVisitor();
|
---|
90 | function serializeNodes(nodes) {
|
---|
91 | return nodes.map(function (a) { return a.visit(serializerVisitor, null); });
|
---|
92 | }
|
---|
93 | exports.serializeNodes = serializeNodes;
|
---|
94 | /**
|
---|
95 | * Serialize the i18n ast to something xml-like in order to generate an UID.
|
---|
96 | *
|
---|
97 | * Ignore the ICU expressions so that message IDs stays identical if only the expression changes.
|
---|
98 | *
|
---|
99 | * @internal
|
---|
100 | */
|
---|
101 | var _SerializerIgnoreIcuExpVisitor = /** @class */ (function (_super) {
|
---|
102 | tslib_1.__extends(_SerializerIgnoreIcuExpVisitor, _super);
|
---|
103 | function _SerializerIgnoreIcuExpVisitor() {
|
---|
104 | return _super !== null && _super.apply(this, arguments) || this;
|
---|
105 | }
|
---|
106 | _SerializerIgnoreIcuExpVisitor.prototype.visitIcu = function (icu, context) {
|
---|
107 | var _this = this;
|
---|
108 | var strCases = Object.keys(icu.cases).map(function (k) { return k + " {" + icu.cases[k].visit(_this) + "}"; });
|
---|
109 | // Do not take the expression into account
|
---|
110 | return "{" + icu.type + ", " + strCases.join(', ') + "}";
|
---|
111 | };
|
---|
112 | return _SerializerIgnoreIcuExpVisitor;
|
---|
113 | }(_SerializerVisitor));
|
---|
114 | /**
|
---|
115 | * Compute the SHA1 of the given string
|
---|
116 | *
|
---|
117 | * see https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
|
---|
118 | *
|
---|
119 | * WARNING: this function has not been designed not tested with security in mind.
|
---|
120 | * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.
|
---|
121 | */
|
---|
122 | function sha1(str) {
|
---|
123 | var utf8 = util_1.utf8Encode(str);
|
---|
124 | var words32 = bytesToWords32(utf8, Endian.Big);
|
---|
125 | var len = utf8.length * 8;
|
---|
126 | var w = util_1.newArray(80);
|
---|
127 | var a = 0x67452301, b = 0xefcdab89, c = 0x98badcfe, d = 0x10325476, e = 0xc3d2e1f0;
|
---|
128 | words32[len >> 5] |= 0x80 << (24 - len % 32);
|
---|
129 | words32[((len + 64 >> 9) << 4) + 15] = len;
|
---|
130 | for (var i = 0; i < words32.length; i += 16) {
|
---|
131 | var h0 = a, h1 = b, h2 = c, h3 = d, h4 = e;
|
---|
132 | for (var j = 0; j < 80; j++) {
|
---|
133 | if (j < 16) {
|
---|
134 | w[j] = words32[i + j];
|
---|
135 | }
|
---|
136 | else {
|
---|
137 | w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
|
---|
138 | }
|
---|
139 | var fkVal = fk(j, b, c, d);
|
---|
140 | var f = fkVal[0];
|
---|
141 | var k = fkVal[1];
|
---|
142 | var temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);
|
---|
143 | e = d;
|
---|
144 | d = c;
|
---|
145 | c = rol32(b, 30);
|
---|
146 | b = a;
|
---|
147 | a = temp;
|
---|
148 | }
|
---|
149 | a = add32(a, h0);
|
---|
150 | b = add32(b, h1);
|
---|
151 | c = add32(c, h2);
|
---|
152 | d = add32(d, h3);
|
---|
153 | e = add32(e, h4);
|
---|
154 | }
|
---|
155 | return bytesToHexString(words32ToByteString([a, b, c, d, e]));
|
---|
156 | }
|
---|
157 | exports.sha1 = sha1;
|
---|
158 | function fk(index, b, c, d) {
|
---|
159 | if (index < 20) {
|
---|
160 | return [(b & c) | (~b & d), 0x5a827999];
|
---|
161 | }
|
---|
162 | if (index < 40) {
|
---|
163 | return [b ^ c ^ d, 0x6ed9eba1];
|
---|
164 | }
|
---|
165 | if (index < 60) {
|
---|
166 | return [(b & c) | (b & d) | (c & d), 0x8f1bbcdc];
|
---|
167 | }
|
---|
168 | return [b ^ c ^ d, 0xca62c1d6];
|
---|
169 | }
|
---|
170 | /**
|
---|
171 | * Compute the fingerprint of the given string
|
---|
172 | *
|
---|
173 | * The output is 64 bit number encoded as a decimal string
|
---|
174 | *
|
---|
175 | * based on:
|
---|
176 | * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
|
---|
177 | */
|
---|
178 | function fingerprint(str) {
|
---|
179 | var utf8 = util_1.utf8Encode(str);
|
---|
180 | var hi = hash32(utf8, 0);
|
---|
181 | var lo = hash32(utf8, 102072);
|
---|
182 | if (hi == 0 && (lo == 0 || lo == 1)) {
|
---|
183 | hi = hi ^ 0x130f9bef;
|
---|
184 | lo = lo ^ -0x6b5f56d8;
|
---|
185 | }
|
---|
186 | return [hi, lo];
|
---|
187 | }
|
---|
188 | exports.fingerprint = fingerprint;
|
---|
189 | function computeMsgId(msg, meaning) {
|
---|
190 | if (meaning === void 0) { meaning = ''; }
|
---|
191 | var msgFingerprint = fingerprint(msg);
|
---|
192 | if (meaning) {
|
---|
193 | var meaningFingerprint = fingerprint(meaning);
|
---|
194 | msgFingerprint = add64(rol64(msgFingerprint, 1), meaningFingerprint);
|
---|
195 | }
|
---|
196 | var hi = msgFingerprint[0];
|
---|
197 | var lo = msgFingerprint[1];
|
---|
198 | return wordsToDecimalString(hi & 0x7fffffff, lo);
|
---|
199 | }
|
---|
200 | exports.computeMsgId = computeMsgId;
|
---|
201 | function hash32(bytes, c) {
|
---|
202 | var a = 0x9e3779b9, b = 0x9e3779b9;
|
---|
203 | var i;
|
---|
204 | var len = bytes.length;
|
---|
205 | for (i = 0; i + 12 <= len; i += 12) {
|
---|
206 | a = add32(a, wordAt(bytes, i, Endian.Little));
|
---|
207 | b = add32(b, wordAt(bytes, i + 4, Endian.Little));
|
---|
208 | c = add32(c, wordAt(bytes, i + 8, Endian.Little));
|
---|
209 | var res = mix(a, b, c);
|
---|
210 | a = res[0], b = res[1], c = res[2];
|
---|
211 | }
|
---|
212 | a = add32(a, wordAt(bytes, i, Endian.Little));
|
---|
213 | b = add32(b, wordAt(bytes, i + 4, Endian.Little));
|
---|
214 | // the first byte of c is reserved for the length
|
---|
215 | c = add32(c, len);
|
---|
216 | c = add32(c, wordAt(bytes, i + 8, Endian.Little) << 8);
|
---|
217 | return mix(a, b, c)[2];
|
---|
218 | }
|
---|
219 | // clang-format off
|
---|
220 | function mix(a, b, c) {
|
---|
221 | a = sub32(a, b);
|
---|
222 | a = sub32(a, c);
|
---|
223 | a ^= c >>> 13;
|
---|
224 | b = sub32(b, c);
|
---|
225 | b = sub32(b, a);
|
---|
226 | b ^= a << 8;
|
---|
227 | c = sub32(c, a);
|
---|
228 | c = sub32(c, b);
|
---|
229 | c ^= b >>> 13;
|
---|
230 | a = sub32(a, b);
|
---|
231 | a = sub32(a, c);
|
---|
232 | a ^= c >>> 12;
|
---|
233 | b = sub32(b, c);
|
---|
234 | b = sub32(b, a);
|
---|
235 | b ^= a << 16;
|
---|
236 | c = sub32(c, a);
|
---|
237 | c = sub32(c, b);
|
---|
238 | c ^= b >>> 5;
|
---|
239 | a = sub32(a, b);
|
---|
240 | a = sub32(a, c);
|
---|
241 | a ^= c >>> 3;
|
---|
242 | b = sub32(b, c);
|
---|
243 | b = sub32(b, a);
|
---|
244 | b ^= a << 10;
|
---|
245 | c = sub32(c, a);
|
---|
246 | c = sub32(c, b);
|
---|
247 | c ^= b >>> 15;
|
---|
248 | return [a, b, c];
|
---|
249 | }
|
---|
250 | // clang-format on
|
---|
251 | // Utils
|
---|
252 | var Endian;
|
---|
253 | (function (Endian) {
|
---|
254 | Endian[Endian["Little"] = 0] = "Little";
|
---|
255 | Endian[Endian["Big"] = 1] = "Big";
|
---|
256 | })(Endian || (Endian = {}));
|
---|
257 | function add32(a, b) {
|
---|
258 | return add32to64(a, b)[1];
|
---|
259 | }
|
---|
260 | function add32to64(a, b) {
|
---|
261 | var low = (a & 0xffff) + (b & 0xffff);
|
---|
262 | var high = (a >>> 16) + (b >>> 16) + (low >>> 16);
|
---|
263 | return [high >>> 16, (high << 16) | (low & 0xffff)];
|
---|
264 | }
|
---|
265 | function add64(a, b) {
|
---|
266 | var ah = a[0], al = a[1];
|
---|
267 | var bh = b[0], bl = b[1];
|
---|
268 | var result = add32to64(al, bl);
|
---|
269 | var carry = result[0];
|
---|
270 | var l = result[1];
|
---|
271 | var h = add32(add32(ah, bh), carry);
|
---|
272 | return [h, l];
|
---|
273 | }
|
---|
274 | function sub32(a, b) {
|
---|
275 | var low = (a & 0xffff) - (b & 0xffff);
|
---|
276 | var high = (a >> 16) - (b >> 16) + (low >> 16);
|
---|
277 | return (high << 16) | (low & 0xffff);
|
---|
278 | }
|
---|
279 | // Rotate a 32b number left `count` position
|
---|
280 | function rol32(a, count) {
|
---|
281 | return (a << count) | (a >>> (32 - count));
|
---|
282 | }
|
---|
283 | // Rotate a 64b number left `count` position
|
---|
284 | function rol64(num, count) {
|
---|
285 | var hi = num[0], lo = num[1];
|
---|
286 | var h = (hi << count) | (lo >>> (32 - count));
|
---|
287 | var l = (lo << count) | (hi >>> (32 - count));
|
---|
288 | return [h, l];
|
---|
289 | }
|
---|
290 | function bytesToWords32(bytes, endian) {
|
---|
291 | var size = (bytes.length + 3) >>> 2;
|
---|
292 | var words32 = [];
|
---|
293 | for (var i = 0; i < size; i++) {
|
---|
294 | words32[i] = wordAt(bytes, i * 4, endian);
|
---|
295 | }
|
---|
296 | return words32;
|
---|
297 | }
|
---|
298 | function byteAt(bytes, index) {
|
---|
299 | return index >= bytes.length ? 0 : bytes[index];
|
---|
300 | }
|
---|
301 | function wordAt(bytes, index, endian) {
|
---|
302 | var word = 0;
|
---|
303 | if (endian === Endian.Big) {
|
---|
304 | for (var i = 0; i < 4; i++) {
|
---|
305 | word += byteAt(bytes, index + i) << (24 - 8 * i);
|
---|
306 | }
|
---|
307 | }
|
---|
308 | else {
|
---|
309 | for (var i = 0; i < 4; i++) {
|
---|
310 | word += byteAt(bytes, index + i) << 8 * i;
|
---|
311 | }
|
---|
312 | }
|
---|
313 | return word;
|
---|
314 | }
|
---|
315 | function words32ToByteString(words32) {
|
---|
316 | return words32.reduce(function (bytes, word) { return bytes.concat(word32ToByteString(word)); }, []);
|
---|
317 | }
|
---|
318 | function word32ToByteString(word) {
|
---|
319 | var bytes = [];
|
---|
320 | for (var i = 0; i < 4; i++) {
|
---|
321 | bytes.push((word >>> 8 * (3 - i)) & 0xff);
|
---|
322 | }
|
---|
323 | return bytes;
|
---|
324 | }
|
---|
325 | function bytesToHexString(bytes) {
|
---|
326 | var hex = '';
|
---|
327 | for (var i = 0; i < bytes.length; i++) {
|
---|
328 | var b = byteAt(bytes, i);
|
---|
329 | hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);
|
---|
330 | }
|
---|
331 | return hex.toLowerCase();
|
---|
332 | }
|
---|
333 | /**
|
---|
334 | * Create a shared exponentiation pool for base-256 computations. This shared pool provides memoized
|
---|
335 | * power-of-256 results with memoized power-of-two computations for efficient multiplication.
|
---|
336 | *
|
---|
337 | * For our purposes, this can be safely stored as a global without memory concerns. The reason is
|
---|
338 | * that we encode two words, so only need the 0th (for the low word) and 4th (for the high word)
|
---|
339 | * exponent.
|
---|
340 | */
|
---|
341 | var base256 = new big_integer_1.BigIntExponentiation(256);
|
---|
342 | /**
|
---|
343 | * Represents two 32-bit words as a single decimal number. This requires a big integer storage
|
---|
344 | * model as JS numbers are not accurate enough to represent the 64-bit number.
|
---|
345 | *
|
---|
346 | * Based on https://www.danvk.org/hex2dec.html
|
---|
347 | */
|
---|
348 | function wordsToDecimalString(hi, lo) {
|
---|
349 | // Encode the four bytes in lo in the lower digits of the decimal number.
|
---|
350 | // Note: the multiplication results in lo itself but represented by a big integer using its
|
---|
351 | // decimal digits.
|
---|
352 | var decimal = base256.toThePowerOf(0).multiplyBy(lo);
|
---|
353 | // Encode the four bytes in hi above the four lo bytes. lo is a maximum of (2^8)^4, which is why
|
---|
354 | // this multiplication factor is applied.
|
---|
355 | base256.toThePowerOf(4).multiplyByAndAddTo(hi, decimal);
|
---|
356 |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