splitPartsByChecksum static method
Split address into two parts, considering the checksum at the end of it.
Throws AddressConverterException if addrBytes is shorter than
checksumLen.
Implementation
static (List<int>, List<int>) splitPartsByChecksum(
List<int> addrBytes,
int checksumLen,
) {
if (addrBytes.length < checksumLen) {
throw CoreErrors.addressValidationFailed(
reason: "Invalid address length.",
);
}
final checksumBytes = addrBytes.sublist(addrBytes.length - checksumLen);
final payloadBytes = addrBytes.sublist(0, addrBytes.length - checksumLen);
return (payloadBytes, checksumBytes);
}