source: trip-planner-front/node_modules/@angular/compiler/esm2015/src/i18n/digest.js@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

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