orderLen static method

int orderLen(
  1. BigInt value
)

Calculates the byte length required to represent a BigInt 'order'.

The method converts 'order' to a hexadecimal string representation and calculates the byte length needed to store the corresponding value.

Returns the number of bytes required to represent 'order'.

Implementation

static int orderLen(BigInt value) {
  String hexOrder = value.toRadixString(16);
  int byteLength = (hexOrder.length + 1) ~/ 2; // Calculate bytes needed
  return byteLength;
}