encodeBound static method

Uint8List encodeBound(
  1. int timestamp,
  2. Uint8List idPrefix
)

Encodes a bound (timestamp + ID prefix)

Implementation

static Uint8List encodeBound(int timestamp, Uint8List idPrefix) {
  final timestampBytes = encodeVarint(timestamp);
  final lengthByte = Uint8List.fromList([idPrefix.length]);
  return Uint8List.fromList([...timestampBytes, ...lengthByte, ...idPrefix]);
}