Skip to main content

Class: UInt32

A 32 bit unsigned integer with values ranging from 0 to 4,294,967,295.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new UInt32(...props)

Parameters

NameType
...propsany[]

Inherited from

CircuitValue.constructor

Defined in

lib/circuit_value.ts:64

Properties

value

value: Field

Defined in

lib/int.ts:249


NUM_BITS

Static NUM_BITS: number = 32

Defined in

lib/int.ts:250

Accessors

one

Static get one(): UInt32

Static method to create a UInt32 with value 0.

Returns

UInt32

Defined in

lib/int.ts:262


zero

Static get zero(): UInt32

Static method to create a UInt32 with value 0.

Returns

UInt32

Defined in

lib/int.ts:255

Methods

add

add(y): UInt32

Addition with overflow checking.

Parameters

NameType
ynumber | UInt32

Returns

UInt32

Defined in

lib/int.ts:401


assertEquals

assertEquals(x): void

Parameters

NameType
xUInt32

Returns

void

Inherited from

CircuitValue.assertEquals

Defined in

lib/circuit_value.ts:152


assertGt

assertGt(y, message?): void

Asserts that a UInt32 is greater than another one.

Parameters

NameType
yUInt32
message?string

Returns

void

Defined in

lib/int.ts:462


assertGte

assertGte(y, message?): void

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

Parameters

NameType
yUInt32
message?string

Returns

void

Defined in

lib/int.ts:475


assertLt

assertLt(y, message?): void

Asserts that a UInt32 is less than another one.

Parameters

NameType
yUInt32
message?string

Returns

void

Defined in

lib/int.ts:450


assertLte

assertLte(y, message?): void

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

Parameters

NameType
yUInt32
message?string

Returns

void

Defined in

lib/int.ts:437


div

div(y): UInt32

Integer division.

x.div(y) returns the floor of x / y, that is, the greatest z such that x * y <= x.

Parameters

NameType
ynumber | UInt32

Returns

UInt32

Defined in

lib/int.ts:378


divMod

divMod(y): Object

Integer division with remainder.

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

Parameters

NameType
ystring | number | UInt32

Returns

Object

NameType
quotientUInt32
restUInt32

Defined in

lib/int.ts:336


equals

equals(x): Bool

Parameters

NameType
xUInt32

Returns

Bool

Inherited from

CircuitValue.equals

Defined in

lib/circuit_value.ts:148


gt

gt(y): Bool

Checks if a UInt32 is greater than another one.

Parameters

NameType
yUInt32

Returns

Bool

Defined in

lib/int.ts:456


gte

gte(y): Bool

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

Parameters

NameType
yUInt32

Returns

Bool

Defined in

lib/int.ts:469


isConstant

isConstant(): boolean

Returns

boolean

Inherited from

CircuitValue.isConstant

Defined in

lib/circuit_value.ts:156


lt

lt(y): Bool

Checks if a UInt32 is less than another one.

Parameters

NameType
yUInt32

Returns

Bool

Defined in

lib/int.ts:444


lte

lte(y): Bool

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

Parameters

NameType
yUInt32

Returns

Bool

Defined in

lib/int.ts:417


mod

mod(y): UInt32

Integer remainder.

x.mod(y) returns the value z such that 0 <= z < y and x - z is divisble by y.

Parameters

NameType
ynumber | UInt32

Returns

UInt32

Defined in

lib/int.ts:387


mul

mul(y): UInt32

Multiplication with overflow checking.

Parameters

NameType
ynumber | UInt32

Returns

UInt32

Defined in

lib/int.ts:393


sub

sub(y): UInt32

Subtraction with underflow checking.

Parameters

NameType
ynumber | UInt32

Returns

UInt32

Defined in

lib/int.ts:409


toBigint

toBigint(): bigint

Turns the UInt32 into a BigInt.

Returns

bigint

Defined in

lib/int.ts:274


toConstant

toConstant(): UInt32

Returns

UInt32

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 UInt32 into a string.

Returns

string

Defined in

lib/int.ts:268


toUInt64

toUInt64(): UInt64

Turns the UInt32 into a UInt64.

Returns

UInt64

Defined in

lib/int.ts:280


MAXINT

Static MAXINT(): UInt32

Creates a UInt32 with a value of 4,294,967,295.

Returns

UInt32

Defined in

lib/int.ts:328


check

Static check(x): void

Parameters

NameType
xUInt32

Returns

void

Overrides

CircuitValue.check

Defined in

lib/int.ts:285


checkConstant

Static Private checkConstant(x): Field

Parameters

NameType
xField

Returns

Field

Defined in

lib/int.ts:306


from

Static from(x): UInt32

Creates a new UInt32.

Parameters

NameType
xstring | number | bigint | Field | UInt32

Returns

UInt32

Defined in

lib/int.ts:321


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:302


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
xUInt32

Returns

HashInput

Overrides

CircuitValue.toInput

Defined in

lib/int.ts:289


toJSON

Static toJSON(x): string

Encodes this structure into a JSON-like object.

Parameters

NameType
xUInt32

Returns

string

Overrides

CircuitValue.toJSON

Defined in

lib/int.ts:295