Uint64.fromBigInt constructor

Uint64.fromBigInt(
  1. BigInt value
)

Implementation

factory Uint64.fromBigInt(BigInt value) {
  if (value.isNegative) {
    throw ArgumentException.invalidOperationArguments(
      "fromBigInt",
      reason: 'value must be non-negative',
    );
  }
  final v = value & BigInt.parse('FFFFFFFFFFFFFFFF', radix: 16);
  final hi = (v >> 32).toUnsigned(32).toInt();
  final lo = v.toUnsigned(32).toInt();
  return Uint64._(hi, lo);
}