bigIntToBytes static method

Uint8List bigIntToBytes(
  1. BigInt num
)

BigInt to Bytes

Implementation

static Uint8List bigIntToBytes(BigInt num) {
  // number to 32b. Must be 0 <= num < B256
  if (num >= BigInt.zero && num < B256) {
    return hexToBytes(padhBigInt(num, 2 * fLen));
  }
  throw Exception('BigInt not in range 0 <= num < B256');
}