Explorer

wasm.unsigned-leb128

description
Encode a non-negative integer as unsigned LEB128 bytes (for Wasm section and body sizes)
type
Fn(n: Number) -> List<Number>
expression
fn(n$0) =>
  match @core.less-than(left: $0, right: 128) {
    true =>
      [$0],
    false =>
      @core.list-concat(
        left: [@core.plus(left: @core.remainder(left: $0, right: 128), right: 128)],
        right: @wasm.unsigned-leb128(n: @core.divide(left: $0, right: 128))
      )
  }
visibility
public
wasm.unsigned-leb128 (project definy, branch snapshot-terms, snapshot ITPh_tTKphq4xOBcY4nA69GG9L2laow7SAtvVJWLQaQ)
id: rDHz9okjSng9Lbt_0tzyvz5jlZFloeArm4ObFHbxHVg
content hash: T0hcXdnZxcNC0kR4yx0eshXQ8O3fMij3atIJWHznONE