bigIntToByteData function
Implementation
ByteData bigIntToByteData(BigInt bigInt) {
final data = ByteData((bigInt.bitLength / 8).ceil());
var _bigInt = bigInt;
for (var i = 1; i <= data.lengthInBytes; i++) {
data.setUint8(data.lengthInBytes - i, _bigInt.toUnsigned(8).toInt());
_bigInt = _bigInt >> 8;
}
return data;
}