Skip to main content

Class: UInt64

A 64 bit unsigned integer with values ranging from 0 to 18,446,744,073,709,551,615.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new UInt64(...props)

Parameters

NameType
...propsany[]

Inherited from

CircuitValue.constructor

Defined in

lib/circuit_value.ts:64

Properties

value

value: Field

Defined in

lib/int.ts:13


NUM_BITS

Static NUM_BITS: number = 64

Defined in

lib/int.ts:14

Accessors

one

Static get one(): UInt64

Static method to create a UInt64 with value 1.

Returns

UInt64

Defined in

lib/int.ts:25


zero

Static get zero(): UInt64

Static method to create a UInt64 with value 0.

Returns

UInt64

Defined in

lib/int.ts:19

Methods

add

add(y): UInt64

Addition with overflow checking.

Parameters

NameType
ynumber | UInt64

Returns

UInt64

Defined in

lib/int.ts:165


assertEquals

assertEquals(x): void

Parameters

NameType
xUInt64

Returns

void

Inherited from

CircuitValue.assertEquals

Defined in

lib/circuit_value.ts:152


assertGt

assertGt(y, message?): void

Asserts that a UInt64 is greater than another one.

Parameters

NameType
yUInt64
message?string

Returns

void

Defined in

lib/int.ts:229


assertGte

assertGte(y, message?): void

Asserts that a UInt64 is greater than or equal to another one.

Parameters

NameType
yUInt64
message?string

Returns

void

Defined in

lib/int.ts:241


assertLt

assertLt(y, message?): void

Asserts that a UInt64 is less than another one.

Parameters

NameType
yUInt64
message?string

Returns

void

Defined in

lib/int.ts:217


assertLte

assertLte(y, message?): void

Asserts that a UInt64 is less than or equal to another one.

Parameters

NameType
yUInt64
message?string

Returns

void

Defined in

lib/int.ts:204


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

NameType
ynumber | UInt64

Returns

UInt64

Defined in

lib/int.ts:139


divMod

divMod(y): Object

Integer division with remainder.

x.divMod(y) returns the quotient and the remainder.

Parameters

NameType
ystring | number | UInt64

Returns

Object

NameType
quotientUInt64
restUInt64

Defined in

lib/int.ts:96


equals

equals(x): Bool

Parameters

NameType
xUInt64

Returns

Bool

Inherited from

CircuitValue.equals

Defined in

lib/circuit_value.ts:148


gt

gt(y): Bool

Checks if a UInt64 is greater than another one.

Parameters

NameType
yUInt64

Returns

Bool

Defined in

lib/int.ts:223


gte

gte(y): Bool

Checks if a UInt64 is greater than or equal to another one.

Parameters

NameType
yUInt64

Returns

Bool

Defined in

lib/int.ts:235


isConstant

isConstant(): boolean

Returns

boolean

Inherited from

CircuitValue.isConstant

Defined in

lib/circuit_value.ts:156


lt

lt(y): Bool

Checks if a UInt64 is less than another one.

Parameters

NameType
yUInt64

Returns

Bool

Defined in

lib/int.ts:211


lte

lte(y): Bool

Checks if a UInt64 is less than or equal to another one.

Parameters

NameType
yUInt64

Returns

Bool

Defined in

lib/int.ts:183


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

NameType
ynumber | UInt64

Returns

UInt64

Defined in

lib/int.ts:149


mul

mul(y): UInt64

Multiplication with overflow checking.

Parameters

NameType
ynumber | UInt64

Returns

UInt64

Defined in

lib/int.ts:156


sub

sub(y): UInt64

Subtraction with underflow checking.

Parameters

NameType
ynumber | UInt64

Returns

UInt64

Defined in

lib/int.ts:174


toBigInt

toBigInt(): bigint

Turns the UInt64 into a BigInt.

Returns

bigint

Defined in

lib/int.ts:39


toConstant

toConstant(): UInt64

Returns

UInt64

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit_value.ts:144


toFields

toFields(): Field[]

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit_value.ts:136


toJSON

toJSON(): any

Returns

any

Inherited from

CircuitValue.toJSON

Defined in

lib/circuit_value.ts:140


toString

toString(): string

Turns the UInt64 into a string.

Returns

string

Defined in

lib/int.ts:32


MAXINT

Static MAXINT(): UInt64

Creates a UInt64 with a value of 18,446,744,073,709,551,615.

Returns

UInt64

Defined in

lib/int.ts:87


check

Static check(x): void

Parameters

NameType
xUInt64

Returns

void

Overrides

CircuitValue.check

Defined in

lib/int.ts:43


checkConstant

Static Private checkConstant(x): Field

Parameters

NameType
xField

Returns

Field

Defined in

lib/int.ts:64


from

Static from(x): UInt64

Creates a new UInt64.

Parameters

NameType
xstring | number | bigint | Field | UInt64 | UInt32

Returns

UInt64

Defined in

lib/int.ts:79


fromFields

Static fromFields<T>(this, xs): InstanceType<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
xsField[]

Returns

InstanceType<T>

Inherited from

CircuitValue.fromFields

Defined in

lib/circuit_value.ts:160


fromJSON

Static fromJSON<T>(x): InstanceType<T>

Decodes a JSON-like object into this structure.

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
xstring

Returns

InstanceType<T>

Overrides

CircuitValue.fromJSON

Defined in

lib/int.ts:60


fromObject

Static fromObject<T>(this, value): InstanceType<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
valueNonMethods<InstanceType<T>>

Returns

InstanceType<T>

Inherited from

CircuitValue.fromObject

Defined in

lib/circuit_value.ts:81


sizeInFields

Static sizeInFields(): number

Returns

number

Inherited from

CircuitValue.sizeInFields

Defined in

lib/circuit_value.ts:88


toAuxiliary

Static toAuxiliary(): []

Returns

[]

Inherited from

CircuitValue.toAuxiliary

Defined in

lib/circuit_value.ts:110


toConstant

Static toConstant<T>(this, t): InstanceType<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
tInstanceType<T>

Returns

InstanceType<T>

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit_value.ts:199


toFields

Static toFields<T>(this, v): Field[]

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType<T>

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit_value.ts:93


toInput

Static toInput(x): HashInput

Parameters

NameType
xUInt64

Returns

HashInput

Overrides

CircuitValue.toInput

Defined in

lib/int.ts:47


toJSON

Static toJSON(x): string

Encodes this structure into a JSON-like object.

Parameters

NameType
xUInt64

Returns

string

Overrides

CircuitValue.toJSON

Defined in

lib/int.ts:53