Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/Uint32

primitives/Uint32

Type Aliases

Uint32Type

Uint32Type = number & object
Defined in: src/primitives/Uint32/Uint32Type.ts:12 Uint32 type 32-bit unsigned integer (0 to 4294967295). Used for block numbers, gas limits, timestamps (until year 2106).

Type Declaration

[brand]
readonly [brand]: "Uint32"

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Variables

MAX

const MAX: Uint32Type
Defined in: src/primitives/Uint32/constants.js:34 Maximum Uint32 value: 2^32 - 1 = 4294967295

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Example


MIN

const MIN: Uint32Type
Defined in: src/primitives/Uint32/constants.js:50 Minimum Uint32 value: 0

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Example


ONE

const ONE: Uint32Type
Defined in: src/primitives/Uint32/constants.js:78 One value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Example


SIZE

const SIZE: 4 = 4
Defined in: src/primitives/Uint32/constants.js:20 Size in bytes (4 bytes for Uint32)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Example


Uint32

const Uint32: object
Defined in: src/primitives/Uint32/index.ts:82

Type Declaration

bitLength()
bitLength: (uint) => number
Calculate bit length of Uint32 value
Parameters
uint
Uint32Type Value
Returns
number Number of bits needed to represent value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
bitwiseAnd()
bitwiseAnd: (uint, b) => Uint32Type
Bitwise AND Uint32 values
Parameters
uint
Uint32Type First operand
b
Uint32Type Second operand
Returns
Uint32Type Result (uint & b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
bitwiseNot()
bitwiseNot: (uint) => Uint32Type
Bitwise NOT Uint32 value
Parameters
uint
Uint32Type Operand
Returns
Uint32Type Result (~uint)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
bitwiseOr()
bitwiseOr: (uint, b) => Uint32Type
Bitwise OR Uint32 values
Parameters
uint
Uint32Type First operand
b
Uint32Type Second operand
Returns
Uint32Type Result (uint | b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
bitwiseXor()
bitwiseXor: (uint, b) => Uint32Type
Bitwise XOR Uint32 values
Parameters
uint
Uint32Type First operand
b
Uint32Type Second operand
Returns
Uint32Type Result (uint ^ b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
clone()
clone: (uint) => Uint32Type
Clone Uint32 value
Parameters
uint
Uint32Type Value to clone
Returns
Uint32Type Cloned value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
dividedBy()
dividedBy: (uint, b) => Uint32Type
Divide Uint32 value (integer division)
Parameters
uint
Uint32Type Dividend
b
Uint32Type Divisor
Returns
Uint32Type Quotient (uint / b) truncated
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If divisor is zero
Example
equals()
equals: (uint, b) => boolean
Check if Uint32 values are equal
Parameters
uint
Uint32Type First value
b
Uint32Type Second value
Returns
boolean true if equal
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
from()
from: (value) => Uint32Type
Create Uint32 from number, bigint, or string
Parameters
value
number, bigint, or decimal/hex string string | number | bigint
Returns
Uint32Type Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If value is out of range or invalid
Example
fromAbiEncoded()
fromAbiEncoded: (bytes) => Uint32Type
Create Uint32 from ABI-encoded bytes (32 bytes, big-endian, left-padded)
Parameters
bytes
Uint8Array<ArrayBufferLike> ABI-encoded byte array (32 bytes)
Returns
Uint32Type Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If bytes length is not 32
Example
fromBigInt()
fromBigInt: (value) => Uint32Type
Create Uint32 from bigint
Parameters
value
bigint bigint value
Returns
Uint32Type Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If value is out of range
Example
fromBytes()
fromBytes: (bytes) => Uint32Type
Create Uint32 from bytes (big-endian, 4 bytes)
Parameters
bytes
Uint8Array<ArrayBufferLike> byte array (must be exactly 4 bytes)
Returns
Uint32Type Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If bytes length is not 4
Example
fromHex()
fromHex: (hex) => Uint32Type
Create Uint32 from hex string
Parameters
hex
string hex string (with or without 0x prefix)
Returns
Uint32Type Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If value is out of range or invalid hex
Example
fromNumber()
fromNumber: (value) => Uint32Type
Create Uint32 from number
Parameters
value
number number value
Returns
Uint32Type Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If value is out of range or invalid
Example
greaterThan()
greaterThan: (uint, b) => boolean
Check if Uint32 value is greater than another
Parameters
uint
Uint32Type First value
b
Uint32Type Second value
Returns
boolean true if uint > b
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
isValid()
isValid: (value) => value is Uint32Type
Check if value is a valid Uint32
Parameters
value
unknown Value to check
Returns
value is Uint32Type true if valid Uint32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
isZero()
isZero: (uint) => boolean
Check if Uint32 value is zero
Parameters
uint
Uint32Type Value to check
Returns
boolean true if zero
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
leadingZeros()
leadingZeros: (uint) => number
Count leading zeros in Uint32 value
Parameters
uint
Uint32Type Value
Returns
number Number of leading zero bits
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
lessThan()
lessThan: (uint, b) => boolean
Check if Uint32 value is less than another
Parameters
uint
Uint32Type First value
b
Uint32Type Second value
Returns
boolean true if uint < b
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
MAX
MAX: Uint32Type
Maximum Uint32 value: 2^32 - 1 = 4294967295
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Example
maximum()
maximum: (uint, b) => Uint32Type
Return maximum of two Uint32 values
Parameters
uint
Uint32Type First value
b
Uint32Type Second value
Returns
Uint32Type Maximum value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
MIN
MIN: Uint32Type
Minimum Uint32 value: 0
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Example
minimum()
minimum: (uint, b) => Uint32Type
Return minimum of two Uint32 values
Parameters
uint
Uint32Type First value
b
Uint32Type Second value
Returns
Uint32Type Minimum value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
minus()
minus: (uint, b) => Uint32Type
Subtract Uint32 value with wrapping
Parameters
uint
Uint32Type First operand
b
Uint32Type Second operand
Returns
Uint32Type Difference (uint - b) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
modulo()
modulo: (uint, b) => Uint32Type
Modulo Uint32 value
Parameters
uint
Uint32Type Dividend
b
Uint32Type Divisor
Returns
Uint32Type Remainder (uint % b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
If divisor is zero
Example
ONE
ONE: Uint32Type
One value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Example
plus()
plus: (uint, b) => Uint32Type
Add Uint32 value with wrapping
Parameters
uint
Uint32Type First operand
b
Uint32Type Second operand
Returns
Uint32Type Sum (uint + b) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
popCount()
popCount: (uint) => number
Count set bits (population count) in Uint32 value
Parameters
uint
Uint32Type Value
Returns
number Number of set bits
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
shiftLeft()
shiftLeft: (uint, bits) => Uint32Type
Left shift Uint32 value
Parameters
uint
Uint32Type Value to shift
bits
number Number of bits to shift (0-31)
Returns
Uint32Type Result (uint shifted left by bits) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
shiftRight()
shiftRight: (uint, bits) => Uint32Type
Right shift Uint32 value (logical shift, zero-fill)
Parameters
uint
Uint32Type Value to shift
bits
number Number of bits to shift (0-31)
Returns
Uint32Type Result (uint shifted right by bits)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
SIZE
SIZE: 4
Size in bytes (4 bytes for Uint32)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Example
times()
times: (uint, b) => Uint32Type
Multiply Uint32 value with wrapping
Parameters
uint
Uint32Type First operand
b
Uint32Type Second operand
Returns
Uint32Type Product (uint * b) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toAbiEncoded()
toAbiEncoded: (uint) => Uint8Array<ArrayBufferLike>
Convert Uint32 to ABI-encoded bytes (32 bytes, big-endian, left-padded with zeros)
Parameters
uint
Uint32Type Uint32 value to convert
Returns
Uint8Array<ArrayBufferLike> 32-byte Uint8Array
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toBigInt()
toBigInt: (uint) => bigint
Convert Uint32 to bigint
Parameters
uint
Uint32Type Uint32 value to convert
Returns
bigint bigint value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toBytes()
toBytes: (uint) => Uint8Array<ArrayBufferLike>
Convert Uint32 to bytes (big-endian, 4 bytes)
Parameters
uint
Uint32Type Uint32 value to convert
Returns
Uint8Array<ArrayBufferLike> 4-byte Uint8Array
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toHex()
toHex: (uint) => string
Convert Uint32 to hex string (with 0x prefix)
Parameters
uint
Uint32Type Uint32 value to convert
Returns
string hex string with 0x prefix
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toNumber()
toNumber: (uint) => number
Convert Uint32 to number
Parameters
uint
Uint32Type Uint32 value to convert
Returns
number number value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toPower()
toPower: (uint, exp) => Uint32Type
Raise Uint32 to power with wrapping
Parameters
uint
Uint32Type Base
exp
Uint32Type Exponent
Returns
Uint32Type Result (uint ^ exp) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
toString()
toString: (uint) => string
Convert Uint32 to string
Parameters
uint
Uint32Type Uint32 value to convert
Returns
string decimal string representation
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
tryFrom()
tryFrom: (value) => Uint32Type | null
Try to create Uint32 from value, return null if invalid
Parameters
value
unknown Value to convert
Returns
Uint32Type | null Uint32 value or null
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Throws
Example
ZERO
ZERO: Uint32Type
Zero value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation
Since
0.0.0
Example

ZERO

const ZERO: Uint32Type
Defined in: src/primitives/Uint32/constants.js:64 Zero value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Example

Functions

bitLength()

bitLength(uint): number
Defined in: src/primitives/Uint32/bitLength.js:16 Calculate bit length of Uint32 value

Parameters

uint
Uint32Type Value

Returns

number Number of bits needed to represent value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


bitwiseAnd()

bitwiseAnd(uint, b): Uint32Type
Defined in: src/primitives/Uint32/bitwiseAnd.js:18 Bitwise AND Uint32 values

Parameters

uint
Uint32Type First operand
b
Uint32Type Second operand

Returns

Uint32Type Result (uint & b)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


bitwiseNot()

bitwiseNot(uint): Uint32Type
Defined in: src/primitives/Uint32/bitwiseNot.js:16 Bitwise NOT Uint32 value

Parameters

uint
Uint32Type Operand

Returns

Uint32Type Result (~uint)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


bitwiseOr()

bitwiseOr(uint, b): Uint32Type
Defined in: src/primitives/Uint32/bitwiseOr.js:18 Bitwise OR Uint32 values

Parameters

uint
Uint32Type First operand
b
Uint32Type Second operand

Returns

Uint32Type Result (uint | b)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


bitwiseXor()

bitwiseXor(uint, b): Uint32Type
Defined in: src/primitives/Uint32/bitwiseXor.js:18 Bitwise XOR Uint32 values

Parameters

uint
Uint32Type First operand
b
Uint32Type Second operand

Returns

Uint32Type Result (uint ^ b)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


clone()

clone(uint): Uint32Type
Defined in: src/primitives/Uint32/clone.js:16 Clone Uint32 value

Parameters

uint
Uint32Type Value to clone

Returns

Uint32Type Cloned value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


dividedBy()

dividedBy(uint, b): Uint32Type
Defined in: src/primitives/Uint32/dividedBy.js:18 Divide Uint32 value (integer division)

Parameters

uint
Uint32Type Dividend
b
Uint32Type Divisor

Returns

Uint32Type Quotient (uint / b) truncated

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If divisor is zero

Example


equals()

equals(uint, b): boolean
Defined in: src/primitives/Uint32/equals.js:18 Check if Uint32 values are equal

Parameters

uint
Uint32Type First value
b
Uint32Type Second value

Returns

boolean true if equal

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


from()

from(value): Uint32Type
Defined in: src/primitives/Uint32/from.js:20 Create Uint32 from number, bigint, or string

Parameters

value
number, bigint, or decimal/hex string string | number | bigint

Returns

Uint32Type Uint32 value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If value is out of range or invalid

Example


fromAbiEncoded()

fromAbiEncoded(bytes): Uint32Type
Defined in: src/primitives/Uint32/fromAbiEncoded.js:17 Create Uint32 from ABI-encoded bytes (32 bytes, big-endian, left-padded)

Parameters

bytes
Uint8Array<ArrayBufferLike> ABI-encoded byte array (32 bytes)

Returns

Uint32Type Uint32 value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If bytes length is not 32

Example


fromBigInt()

fromBigInt(value): Uint32Type
Defined in: src/primitives/Uint32/fromBigInt.js:17 Create Uint32 from bigint

Parameters

value
bigint bigint value

Returns

Uint32Type Uint32 value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If value is out of range

Example


fromBytes()

fromBytes(bytes): Uint32Type
Defined in: src/primitives/Uint32/fromBytes.js:18 Create Uint32 from bytes (big-endian, 4 bytes)

Parameters

bytes
Uint8Array<ArrayBufferLike> byte array (must be exactly 4 bytes)

Returns

Uint32Type Uint32 value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If bytes length is not 4

Example


fromHex()

fromHex(hex): Uint32Type
Defined in: src/primitives/Uint32/fromHex.js:18 Create Uint32 from hex string

Parameters

hex
string hex string (with or without 0x prefix)

Returns

Uint32Type Uint32 value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If value is out of range or invalid hex

Example


fromNumber()

fromNumber(value): Uint32Type
Defined in: src/primitives/Uint32/fromNumber.js:17 Create Uint32 from number

Parameters

value
number number value

Returns

Uint32Type Uint32 value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If value is out of range or invalid

Example


greaterThan()

greaterThan(uint, b): boolean
Defined in: src/primitives/Uint32/greaterThan.js:18 Check if Uint32 value is greater than another

Parameters

uint
Uint32Type First value
b
Uint32Type Second value

Returns

boolean true if uint > b

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


isValid()

isValid(value): value is Uint32Type
Defined in: src/primitives/Uint32/isValid.js:19 Check if value is a valid Uint32

Parameters

value
unknown Value to check

Returns

value is Uint32Type true if valid Uint32

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


isZero()

isZero(uint): boolean
Defined in: src/primitives/Uint32/isZero.js:16 Check if Uint32 value is zero

Parameters

uint
Uint32Type Value to check

Returns

boolean true if zero

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


leadingZeros()

leadingZeros(uint): number
Defined in: src/primitives/Uint32/leadingZeros.js:16 Count leading zeros in Uint32 value

Parameters

uint
Uint32Type Value

Returns

number Number of leading zero bits

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


lessThan()

lessThan(uint, b): boolean
Defined in: src/primitives/Uint32/lessThan.js:18 Check if Uint32 value is less than another

Parameters

uint
Uint32Type First value
b
Uint32Type Second value

Returns

boolean true if uint < b

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


maximum()

maximum(uint, b): Uint32Type
Defined in: src/primitives/Uint32/maximum.js:18 Return maximum of two Uint32 values

Parameters

uint
Uint32Type First value
b
Uint32Type Second value

Returns

Uint32Type Maximum value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


minimum()

minimum(uint, b): Uint32Type
Defined in: src/primitives/Uint32/minimum.js:18 Return minimum of two Uint32 values

Parameters

uint
Uint32Type First value
b
Uint32Type Second value

Returns

Uint32Type Minimum value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


minus()

minus(uint, b): Uint32Type
Defined in: src/primitives/Uint32/minus.js:18 Subtract Uint32 value with wrapping

Parameters

uint
Uint32Type First operand
b
Uint32Type Second operand

Returns

Uint32Type Difference (uint - b) mod 2^32

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


modulo()

modulo(uint, b): Uint32Type
Defined in: src/primitives/Uint32/modulo.js:18 Modulo Uint32 value

Parameters

uint
Uint32Type Dividend
b
Uint32Type Divisor

Returns

Uint32Type Remainder (uint % b)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

If divisor is zero

Example


plus()

plus(uint, b): Uint32Type
Defined in: src/primitives/Uint32/plus.js:18 Add Uint32 value with wrapping

Parameters

uint
Uint32Type First operand
b
Uint32Type Second operand

Returns

Uint32Type Sum (uint + b) mod 2^32

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


popCount()

popCount(uint): number
Defined in: src/primitives/Uint32/popCount.js:16 Count set bits (population count) in Uint32 value

Parameters

uint
Uint32Type Value

Returns

number Number of set bits

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


shiftLeft()

shiftLeft(uint, bits): Uint32Type
Defined in: src/primitives/Uint32/shiftLeft.js:17 Left shift Uint32 value

Parameters

uint
Uint32Type Value to shift
bits
number Number of bits to shift (0-31)

Returns

Uint32Type Result (uint shifted left by bits) mod 2^32

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


shiftRight()

shiftRight(uint, bits): Uint32Type
Defined in: src/primitives/Uint32/shiftRight.js:17 Right shift Uint32 value (logical shift, zero-fill)

Parameters

uint
Uint32Type Value to shift
bits
number Number of bits to shift (0-31)

Returns

Uint32Type Result (uint shifted right by bits)

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


times()

times(uint, b): Uint32Type
Defined in: src/primitives/Uint32/times.js:18 Multiply Uint32 value with wrapping

Parameters

uint
Uint32Type First operand
b
Uint32Type Second operand

Returns

Uint32Type Product (uint * b) mod 2^32

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toAbiEncoded()

toAbiEncoded(uint): Uint8Array<ArrayBufferLike>
Defined in: src/primitives/Uint32/toAbiEncoded.js:16 Convert Uint32 to ABI-encoded bytes (32 bytes, big-endian, left-padded with zeros)

Parameters

uint
Uint32Type Uint32 value to convert

Returns

Uint8Array<ArrayBufferLike> 32-byte Uint8Array

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toBigInt()

toBigInt(uint): bigint
Defined in: src/primitives/Uint32/toBigInt.js:16 Convert Uint32 to bigint

Parameters

uint
Uint32Type Uint32 value to convert

Returns

bigint bigint value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toBytes()

toBytes(uint): Uint8Array<ArrayBufferLike>
Defined in: src/primitives/Uint32/toBytes.js:18 Convert Uint32 to bytes (big-endian, 4 bytes)

Parameters

uint
Uint32Type Uint32 value to convert

Returns

Uint8Array<ArrayBufferLike> 4-byte Uint8Array

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toHex()

toHex(uint): string
Defined in: src/primitives/Uint32/toHex.js:16 Convert Uint32 to hex string (with 0x prefix)

Parameters

uint
Uint32Type Uint32 value to convert

Returns

string hex string with 0x prefix

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toNumber()

toNumber(uint): number
Defined in: src/primitives/Uint32/toNumber.js:16 Convert Uint32 to number

Parameters

uint
Uint32Type Uint32 value to convert

Returns

number number value

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toPower()

toPower(uint, exp): Uint32Type
Defined in: src/primitives/Uint32/toPower.js:18 Raise Uint32 to power with wrapping

Parameters

uint
Uint32Type Base
exp
Uint32Type Exponent

Returns

Uint32Type Result (uint ^ exp) mod 2^32

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


toString()

toString(uint): string
Defined in: src/primitives/Uint32/toString.js:17 Convert Uint32 to string

Parameters

uint
Uint32Type Uint32 value to convert

Returns

string decimal string representation

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example


tryFrom()

tryFrom(value): Uint32Type | null
Defined in: src/primitives/Uint32/tryFrom.js:19 Try to create Uint32 from value, return null if invalid

Parameters

value
unknown Value to convert

Returns

Uint32Type | null Uint32 value or null

See

https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentation

Since

0.0.0

Throws

Example