Class: UInt64
A 64 bit unsigned integer with values ranging from 0 to 18,446,744,073,709,551,615.
Hierarchy
↳
UInt64
Table of contents
Constructors
Properties
Accessors
Methods
- add
- assertEquals
- assertGreaterThan
- assertGreaterThanOrEqual
- assertGt
- assertGte
- assertLessThan
- assertLessThanOrEqual
- assertLt
- assertLte
- div
- divMod
- equals
- greaterThan
- greaterThanOrEqual
- gt
- gte
- isConstant
- lessThan
- lessThanOrEqual
- lt
- lte
- mod
- mul
- sub
- toBigInt
- toConstant
- toFields
- toJSON
- toString
- toUInt32
- toUInt32Clamped
- MAXINT
- check
- checkConstant
- from
- fromFields
- fromJSON
- fromObject
- sizeInFields
- toAuxiliary
- toConstant
- toFields
- toInput
- toJSON
Constructors
constructor
• new UInt64(...props)
Parameters
| Name | Type |
|---|---|
...props | any[] |
Inherited from
Defined in
Properties
value
• value: Field
Defined in
NUM_BITS
▪ Static NUM_BITS: number = 64
Defined in
Accessors
one
• Static get one(): UInt64
Static method to create a UInt64 with value 1.
Returns
Defined in
zero
• Static get zero(): UInt64
Static method to create a UInt64 with value 0.
Returns
Defined in
Methods
add
▸ add(y): UInt64
Addition with overflow checking.
Parameters
| Name | Type |
|---|---|
y | number | UInt64 |
Returns
Defined in
assertEquals
▸ assertEquals(x): void
Parameters
| Name | Type |
|---|---|
x | UInt64 |
Returns
void
Inherited from
Defined in
assertGreaterThan
▸ assertGreaterThan(y, message?): void
Asserts that a UInt64 is greater than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertGreaterThanOrEqual
▸ assertGreaterThanOrEqual(y, message?): void
Asserts that a UInt64 is greater than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertGt
▸ assertGt(y, message?): void
Deprecated
Use assertGreaterThan instead.
Asserts that a UInt64 is greater than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertGte
▸ assertGte(y, message?): void
Deprecated
Use assertGreaterThanOrEqual instead.
Asserts that a UInt64 is greater than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertLessThan
▸ assertLessThan(y, message?): void
Asserts that a UInt64 is less than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertLessThanOrEqual
▸ assertLessThanOrEqual(y, message?): void
Asserts that a UInt64 is less than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertLt
▸ assertLt(y, message?): void
Deprecated
Use assertLessThan instead.
Asserts that a UInt64 is less than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
assertLte
▸ assertLte(y, message?): void
Deprecated
Use assertLessThanOrEqual instead.
Asserts that a UInt64 is less than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
message? | string |
Returns
void
Defined in
div
▸ div(y): UInt64
Integer division.
x.div(y) returns the floor of x / y, that is, the greatest
z such that z * y <= x.
Parameters
| Name | Type |
|---|---|
y | number | UInt64 |
Returns
Defined in
divMod
▸ divMod(y): Object
Integer division with remainder.
x.divMod(y) returns the quotient and the remainder.
Parameters
| Name | Type |
|---|---|
y | string | number | UInt64 |
Returns
Object
| Name | Type |
|---|---|
quotient | UInt64 |
rest | UInt64 |
Defined in
equals
▸ equals(x): Bool
Parameters
| Name | Type |
|---|---|
x | UInt64 |
Returns
Inherited from
Defined in
greaterThan
▸ greaterThan(y): Bool
Checks if a UInt64 is greater than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
greaterThanOrEqual
▸ greaterThanOrEqual(y): Bool
Checks if a UInt64 is greater than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
gt
▸ gt(y): Bool
Deprecated
Use greaterThan instead.
Checks if a UInt64 is greater than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
gte
▸ gte(y): Bool
Deprecated
Use greaterThanOrEqual instead.
Checks if a UInt64 is greater than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
isConstant
▸ isConstant(): boolean
Returns
boolean
Inherited from
Defined in
lessThan
▸ lessThan(y): Bool
Checks if a UInt64 is less than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
lessThanOrEqual
▸ lessThanOrEqual(y): Bool
Checks if a UInt64 is less than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
lt
▸ lt(y): Bool
Deprecated
Use lessThan instead.
Checks if a UInt64 is less than another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
lte
▸ lte(y): Bool
Deprecated
Use lessThanOrEqual instead.
Checks if a UInt64 is less than or equal to another one.
Parameters
| Name | Type |
|---|---|
y | UInt64 |
Returns
Defined in
mod
▸ mod(y): UInt64
Integer remainder.
x.mod(y) returns the value z such that 0 <= z < y and
x - z is divisble by y.
Parameters
| Name | Type |
|---|---|
y | number | UInt64 |
Returns
Defined in
mul
▸ mul(y): UInt64
Multiplication with overflow checking.
Parameters
| Name | Type |
|---|---|
y | number | UInt64 |
Returns
Defined in
sub
▸ sub(y): UInt64
Subtraction with underflow checking.
Parameters
| Name | Type |
|---|---|
y | number | UInt64 |
Returns
Defined in
toBigInt
▸ toBigInt(): bigint
Turns the UInt64 into a BigInt.
Returns
bigint
Defined in
toConstant
▸ toConstant(): UInt64
Returns
Inherited from
Defined in
toFields
▸ toFields(): Field[]
Returns
Field[]
Inherited from
Defined in
toJSON
▸ toJSON(): any
Returns
any
Inherited from
Defined in
toString
▸ toString(): string
Turns the UInt64 into a string.
Returns
string
Defined in
toUInt32
▸ toUInt32(): UInt32
Turns the UInt64 into a UInt32, asserting that it fits in 32 bits.
Returns
Defined in
toUInt32Clamped
▸ toUInt32Clamped(): UInt32
Turns the UInt64 into a UInt32, clamping to the 32 bits range if it's too large.
UInt64.from(4294967296).toUInt32Clamped().toString(); // "4294967295"
Returns
Defined in
MAXINT
▸ Static MAXINT(): UInt64
Creates a UInt64 with a value of 18,446,744,073,709,551,615.
Returns
Defined in
check
▸ Static check(x): void
Parameters
| Name | Type |
|---|---|
x | UInt64 |
Returns
void
Overrides
Defined in
checkConstant
▸ Static Private checkConstant(x): Field
Parameters
| Name | Type |
|---|---|
x | Field |
Returns
Defined in
from
▸ Static from(x): UInt64
Creates a new UInt64.
Parameters
| Name | Type |
|---|---|
x | string | number | bigint | Field | UInt64 | UInt32 |
Returns
Defined in
fromFields
▸ Static fromFields<T>(this, xs): InstanceType<T>
Type parameters
| Name | Type |
|---|---|
T | extends AnyConstructor |
Parameters
| Name | Type |
|---|---|
this | T |
xs | Field[] |
Returns
InstanceType<T>
Inherited from
Defined in
fromJSON
▸ Static fromJSON<T>(x): InstanceType<T>
Decodes a JSON-like object into this structure.
Type parameters
| Name | Type |
|---|---|
T | extends AnyConstructor |
Parameters
| Name | Type |
|---|---|
x | string |
Returns
InstanceType<T>
Overrides
Defined in
fromObject
▸ Static fromObject<T>(this, value): InstanceType<T>
Type parameters
| Name | Type |
|---|---|
T | extends AnyConstructor |
Parameters
| Name | Type |
|---|---|
this | T |
value | NonMethods<InstanceType<T>> |
Returns
InstanceType<T>
Inherited from
Defined in
sizeInFields
▸ Static sizeInFields(): number
Returns
number
Inherited from
Defined in
toAuxiliary
▸ Static toAuxiliary(): []
Returns
[]
Inherited from
Defined in
toConstant
▸ Static toConstant<T>(this, t): InstanceType<T>
Type parameters
| Name | Type |
|---|---|
T | extends AnyConstructor |
Parameters
| Name | Type |
|---|---|
this | T |
t | InstanceType<T> |
Returns
InstanceType<T>
Inherited from
Defined in
toFields
▸ Static toFields<T>(this, v): Field[]
Type parameters
| Name | Type |
|---|---|
T | extends AnyConstructor |
Parameters
| Name | Type |
|---|---|
this | T |
v | InstanceType<T> |
Returns
Field[]
Inherited from
Defined in
toInput
▸ Static toInput(x): HashInput
Parameters
| Name | Type |
|---|---|
x | UInt64 |
Returns
HashInput
Overrides
Defined in
toJSON
▸ Static toJSON(x): string
Encodes this structure into a JSON-like object.
Parameters
| Name | Type |
|---|---|
x | UInt64 |
Returns
string