MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / decodeChar

Function decodeChar

scripts/createInvisibleText.js:254–263  ·  view source on GitHub ↗
(encodedChar)

Source from the content-addressed store, hash-verified

252 return text.replace(shouldEncodePattern, " " + _encode(matches[1]));
253};
254const decodeChar = (encodedChar) => {
255 encodedChar = encodedChar.reverse();
256 let curr = 1;
257 let charCode = 0;
258 for (let digit of encodedChar) {
259 charCode += digit * curr;
260 curr *= BASE;
261 }
262 return String.fromCodePoint(charCode);
263};
264const _decode = (s) => {
265 s = encodedPattern.exec(s)[1];
266 let curr = [];

Callers 1

_decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected