mirror of
https://github.com/status-im/nim-stew.git
synced 2025-01-09 11:45:42 +00:00
5cf4feabea
Leb128 is a variable-length encoding for unsigned integers that is used in a number of contexts - in particular, wasm, dwarf and protobuf. This is an optimized low-level implementation that unrolls the loop reading/writing the buffer - it is suitable to use as base for a more specific API - no memory allocations, no exceptions. This PR also fixes bitops2 to not raise on certaing uint->int conversions, adapting bitops to nim 1.0 conversion rules by using a cast instead of raising on uint->int conversion