decodeLength function

int decodeLength(
  1. Uint8List input,
  2. int lengthLength,
  3. int offset
)

Implementation

int decodeLength(
  Uint8List input,
  int lengthLength,
  int offset,
) {
  final buffer = input.sublist(offset, offset + lengthLength);
  if (buffer.length > 1 && buffer[0] == 0) {
    throw RLPException('Leading zeros are not allowed');
  }
  return buffer.toUInt;
}