Skip to content

Commit 83fa97a

Browse files
committed
utils: vlq
1 parent 74e677e commit 83fa97a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/utils/vlq.cr

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,16 @@ module MoonScript
3636
cond = vlq > 0
3737
end
3838
end
39+
40+
private def self.base64_encode(int)
41+
BASE64_DIGITS[int]? || raise ArgumentError.new "#{int} is not valid base64 digit"
42+
end
43+
44+
private def self.to_vlq_signed(int)
45+
if int < 0
46+
((-int) << 1) + 1
47+
else
48+
int << 1
49+
end
3950
end
4051
end

0 commit comments

Comments
 (0)