MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / encode_vlq

Function encode_vlq

tools/wasm-sourcemap.py:109–116  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

107
108
109def encode_vlq(n):
110 VLQ_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
111 x = (n << 1) if n >= 0 else ((-n << 1) + 1)
112 result = ""
113 while x > 31:
114 result += VLQ_CHARS[32 + (x & 31)]
115 x >>= 5
116 return result + VLQ_CHARS[x]
117
118
119def read_var_uint(wasm, pos):

Callers 1

build_sourcemapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected