encodeVarUInt7 static method

int encodeVarUInt7(
  1. int n
)

Encodes a varUInt7.

Implementation

static int encodeVarUInt7(int n) {
  if (n < 0 || n > 127) {
    throw ArgumentError('Value is out of range for varUInt7: $n');
  }

  final encoded = n & 0x7F;
  return encoded;
}