readBigInt method
Implementation
BigInt readBigInt(int number, {Endianness endianness = Endianness.Big}) {
Uint8List d = readBytes(number);
BigInt value = new BigInt.from(0);
if (endianness == Endianness.Big) {
for (var n = 0; n < d.length; n++) {
value <<= 256;
value += new BigInt.from(d[d.length - n - 1]);
}
} else if (endianness == Endianness.Little) {
for (var n = d.length - 1; n >= 0; n--) {
value <<= 256;
value += new BigInt.from(d[d.length - n - 1]);
}
}
return value;
}