MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / symbol_for

Function symbol_for

scripts/mangle-javascript-port-identifiers.py:131–143  ·  view source on GitHub ↗

Produce a $-prefixed base62 symbol for the given rank.

(index: int)

Source from the content-addressed store, hash-verified

129
130
131def symbol_for(index: int) -> str:
132 """Produce a $-prefixed base62 symbol for the given rank."""
133 if index < 0:
134 raise ValueError(index)
135 chars: list[str] = []
136 n = index
137 while True:
138 chars.append(_SYMBOL_ALPHABET[n % 62])
139 n //= 62
140 if n == 0:
141 break
142 n -= 1
143 return "$" + "".join(reversed(chars))
144
145
146def collect_files(out_dir: Path) -> list[Path]:

Callers 1

build_mappingFunction · 0.85

Calls 2

appendMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected