encodeLength static method

List<int> encodeLength(
  1. int length
)

Implementation

static List<int> encodeLength(int length) {
  if (length <= 127) {
    return <int>[length];
  }
  final bytes = bigIntToBytes(BigInt.from(length));
  return <int>[
    bytes.length | 0x80,
    ...bytes,
  ];
}