(n)
| 107 | |
| 108 | |
| 109 | def 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 | |
| 119 | def read_var_uint(wasm, pos): |