MCPcopy
hub / github.com/angular/angular / computeMsgId

Function computeMsgId

packages/compiler/src/i18n/digest.ts:224–237  ·  view source on GitHub ↗
(msg: string, meaning: string = '')

Source from the content-addressed store, hash-verified

222}
223
224export function computeMsgId(msg: string, meaning: string = ''): string {
225 let msgFingerprint = fingerprint(msg);
226
227 if (meaning) {
228 // Rotate the 64-bit message fingerprint one bit to the left and then add the meaning
229 // fingerprint.
230 msgFingerprint =
231 BigInt.asUintN(64, msgFingerprint << BigInt(1)) |
232 ((msgFingerprint >> BigInt(63)) & BigInt(1));
233 msgFingerprint += fingerprint(meaning);
234 }
235
236 return BigInt.asUintN(63, msgFingerprint).toString();
237}
238
239function hash32(view: DataView, length: number, c: number): number {
240 let a = 0x9e3779b9,

Callers 11

digest_spec.tsFile · 0.90
parseMessageFunction · 0.90
i18n_spec.tsFile · 0.90
hmr_spec.tsFile · 0.90
computeDecimalDigestFunction · 0.85
computeIdsFunction · 0.85
parseTranslationsFunction · 0.85

Calls 2

fingerprintFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…