MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / b64UTFEncode

Method b64UTFEncode

static/panes/editor.ts:710–716  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

708 }
709
710 b64UTFEncode(str: string): string {
711 return Buffer.from(
712 encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, v) => {
713 return String.fromCharCode(Number.parseInt(v, 16));
714 }),
715 ).toString('base64');
716 }
717
718 asciiEncodeJsonText(json: string): string {
719 return json.replace(/[\u007F-\uFFFF]/g, chr => {

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected