bitlengthInBytes static method

int bitlengthInBytes(
  1. BigInt value
)

Implementation

static int bitlengthInBytes(BigInt value) {
  int bitlength = value.bitLength;
  if (value.isNegative) {
    bitlength++;
  }
  return (bitlength + 7) ~/ 8;

  // return (value.abs().bitLength + 7) ~/ 8;
}