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

Function lenCalc

scripts/createInvisibleText.js:214–222  ·  view source on GitHub ↗
(base, chars)

Source from the content-addressed store, hash-verified

212 return curr;
213}, {});
214const lenCalc = (base, chars) => {
215 var len = 0;
216 var curr = 1;
217 while (curr < chars) {
218 curr *= base;
219 len++;
220 }
221 return len;
222};
223const UNICODE_CHARS = 1114112;
224const BASE = CHARS.length;
225const LEN = lenCalc(BASE, UNICODE_CHARS);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected