Module Imandrakit_leb128.Decode

val decode_zigzag : int64 -> int64

Turn an unsigned integer into a signed one.

See https://en.wikipedia.org/wiki/Variable-length_quantity#Zigzag_encoding

val skip : Imandrakit_bytes.Byte_slice.t -> int -> int

skip slice off reads an integer at offset off, and returns how many bytes the integer occupies.

val u64 : Imandrakit_bytes.Byte_slice.t -> int -> int64 * int

u64 slice off reads an integer at offset off, and returns a pair v, n_consumed. v is the read integer, n_consumed is the number of bytes consumed during reading.

val i64 : Imandrakit_bytes.Byte_slice.t -> int -> int64 * int

Read a signed int64 by reading a u64 and zigzag decoding it

val int_truncate : Imandrakit_bytes.Byte_slice.t -> int -> int * int

Like i64 but truncates to integer. Returns a pair v, n_consumed.

val uint_truncate : Imandrakit_bytes.Byte_slice.t -> int -> int * int

Like u64 but truncates to integer.