convertByteListToBigInt function
Convert a byte list to a BigInt. Source: https://github.com/dart-lang/sdk/issues/32803#issuecomment-1228291047
Implementation
BigInt convertByteListToBigInt(List<int> bytes) {
BigInt result = BigInt.zero;
for (final byte in bytes) {
// Reading in big-endian, so we essentially concat the new byte to the end.
result = (result << 8) | BigInt.from(byte & 0xff);
}
return result;
}