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

Function _encode

scripts/createInvisibleText.js:241–248  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

239 return convertedChar.reduce((curr, digit) => curr + CHARS[digit], "");
240};
241const _encode = (s) => {
242 let converted = [];
243 for (let c of s) {
244 converted.push(charConvert(c));
245 }
246 let res = converted.map(charEncode);
247 return PADDING_START + res.join("") + PADDING_END;
248};
249export const encode = (text) => {
250 let matches = shouldEncodePattern.exec(text);
251 if (!matches) return text;

Callers 2

encodeFunction · 0.85

Calls 1

charConvertFunction · 0.85

Tested by

no test coverage detected