bigToBytes function

List<int> bigToBytes(
  1. BigInt integer
)

Implementation

List<int> bigToBytes(BigInt integer) {
  var hexNum = integer.toRadixString(16);
  if (hexNum.length % 2 == 1) {
    hexNum = '0' + hexNum;
  }
  return hex.decode(hexNum.padLeft(64, '0'));
}