Uint64 class

Implemented types

Constructors

Uint64(int value)
Builds from a plain Dart int. Must be non-negative and representable exactly as a double (i.e. <= 2^53, which covers every case where the value didn't already come from hi/lo limbs). For values above 2^53 use fromBigInt or parseHex/parseDecimal.
factory
Uint64.from(int value)
Builds from a plain Dart int, accepting negative values by taking their two's-complement bit pattern (masked to 64 bits) instead of throwing like Uint64.new does — e.g. Uint64.from(-1) == Uint64.max. value must itself be a normal double-safe Dart int (|value| <= 2^53); mirrors the negation trick Int64.new already uses.
factory
Uint64.fromBigInt(BigInt value)
factory
Uint64.fromParts(int hi, int lo)
factory
Uint64.uncheckedU32(int n)
const
Uint64.unsafe(int _hi, int _lo)
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
hi → int
no setter
isEven → bool
no setter
isOdd → bool
no setter
isZero → bool
no setter
lo → int
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addChecked(Uint64 other) → Uint64
Throws IntegerError instead of wrapping on overflow.
compareTo(Uint64 other) → int
Compares this object to another object.
override
mulChecked(Uint64 other) → Uint64
Throws IntegerError instead of wrapping on overflow.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subChecked(Uint64 other) → Uint64
Throws IntegerError instead of wrapping on underflow.
toBigInt() → BigInt
toBytes([Endian endian = Endian.big]) → BuBytes
Fixed 8-byte encoding, straight from the hi/lo limbs — no BigInt involved at any point.
toHexString({bool padded = true}) → String
toInt() → int
Only safe if the value fits in 53 bits (i.e. hi <= 0x1FFFFF). Throws otherwise — use toBigInt for the general case.
toString() → String
A string representation of this object.
override
toUint8() → int

Operators

operator %(Uint64 other) → Uint64
operator &(Uint64 other) → Uint64
operator *(Uint64 other) → Uint64
operator +(Uint64 other) → Uint64
operator -(Uint64 other) → Uint64
operator <(Uint64 other) → bool
operator <<(int n) → Uint64
Logical (unsigned) left shift. There's no arithmetic-shift distinction for an unsigned type.
operator <=(Uint64 other) → bool
operator ==(Object other) → bool
The equality operator.
override
operator >(Uint64 other) → bool
operator >=(Uint64 other) → bool
operator >>(int n) → Uint64
Logical (unsigned) right shift.
operator >>>(int n) → Uint64
operator ^(Uint64 other) → Uint64
operator unary-() → Uint64
operator |(Uint64 other) → Uint64
operator ~() → Uint64
operator ~/(Uint64 other) → Uint64

Static Methods

adc(Uint64 a, Uint64 b, Uint64 carry) → (Uint64, Uint64)
ctEquals(List<Uint64> a, List<Uint64> b) → bool
XOR-accumulate equality check across two same-length limb lists — avoids short-circuiting on the first differing limb, matching the intent of typical constant-time field-element comparisons.
ctEqualsMask(List<Uint64> a, List<Uint64> b) → Uint64
Mask form of ctEquals: all-ones iff the limb lists are equal. Fixed iteration count; no early exit.
ctSelect(Uint64 a, Uint64 b, bool choice) → Uint64
Branchless select: returns b if choice else a. Built from a bitmask blend, matching the shape of typical constant-time field code (this is a helper, not a hardened constant-time guarantee — Dart's runtime doesn't guarantee branchless codegen).
fromBytes(List<int> bytes, {int offset = 0, Endian endian = Endian.big}) → Uint64
Parses an 8-byte unsigned integer directly into hi/lo limbs
isZeroMask(Uint64 x) → Uint64
All-ones iff x is zero, else zero. Branch-free mask builder for code-level constant-time selects (no ?:/if on the value).
mac(Uint64 a, Uint64 b, Uint64 c, Uint64 carry) → (Uint64, Uint64)
parseDecimal(String s) → Uint64
Strict decimal parse: throws IntegerError on overflow, unlike the wrapping */+ operators.
parseHex(String s) → Uint64
sbb(Uint64 a, Uint64 b, Uint64 borrowIn) → (Uint64, Uint64)
selectBit(Uint64 a, Uint64 b, Uint64 bit) → Uint64
Branch-free select on a 0/1 bit: returns b iff bit == 1, else a. The bit must already be a 0/1 Uint64 (never a bool), so no bool-to-mask conversion — which would itself be a branch — is needed.
widenMul(Uint64 a, Uint64 b) → (Uint64, Uint64)
Full 128-bit product of a * b, returned as (high, low) Uint64.
widenMulPortable(Uint64 a, Uint64 b) → (Uint64, Uint64)
Full 128-bit product of a * b, returned as (high, low) Uint64. Web-safe: works entirely in 16-bit digits, never forms an intermediate above 2^53.

Constants

mask8 → const Uint64
max → const Uint64
maxInt → const Uint64
maxU32 → const Uint64
one → const Uint64
two → const Uint64
zero → const Uint64