splitPartsByChecksum static method

Tuple<List<int>, List<int>> splitPartsByChecksum(
  1. List<int> addrBytes,
  2. int checksumLen
)

Split address into two parts, considering the checksum at the end of it.

Implementation

static Tuple<List<int>, List<int>> splitPartsByChecksum(
  List<int> addrBytes,
  int checksumLen,
) {
  final checksumBytes = addrBytes.sublist(addrBytes.length - checksumLen);
  final payloadBytes = addrBytes.sublist(0, addrBytes.length - checksumLen);

  return Tuple(payloadBytes, checksumBytes);
}