MCPcopy Index your code
hub / github.com/angular/angular / toBase64String

Function toBase64String

packages/compiler/src/output/source_map.ts:152–166  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

150}
151
152export function toBase64String(value: string): string {
153 let b64 = '';
154 const encoded = utf8Encode(value);
155 for (let i = 0; i < encoded.length; ) {
156 const i1 = encoded[i++];
157 const i2 = i < encoded.length ? encoded[i++] : null;
158 const i3 = i < encoded.length ? encoded[i++] : null;
159 b64 += toBase64Digit(i1 >> 2);
160 b64 += toBase64Digit(((i1 & 3) << 4) | (i2 === null ? 0 : i2 >> 4));
161 b64 += i2 === null ? '=' : toBase64Digit(((i2 & 15) << 2) | (i3 === null ? 0 : i3 >> 6));
162 b64 += i2 === null || i3 === null ? '=' : toBase64Digit(i3 & 63);
163 }
164
165 return b64;
166}
167
168function toBase64VLQ(value: number): string {
169 value = value < 0 ? (-value << 1) + 1 : value << 1;

Callers 2

source_map_spec.tsFile · 0.90
toJsCommentMethod · 0.85

Calls 2

utf8EncodeFunction · 0.90
toBase64DigitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…