@tevm/voltaire / primitives/Uint32
primitives/Uint32
Type Aliases
Uint32Type
Uint32Type =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).number&object
Type Declaration
[brand]
readonly[brand]:"Uint32"
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Variables
MAX
Defined in: src/primitives/Uint32/constants.js:34 Maximum Uint32 value: 2^32 - 1 = 4294967295constMAX:Uint32Type
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
MIN
Defined in: src/primitives/Uint32/constants.js:50 Minimum Uint32 value: 0constMIN:Uint32Type
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
ONE
Defined in: src/primitives/Uint32/constants.js:78 One valueconstONE:Uint32Type
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
SIZE
Defined in: src/primitives/Uint32/constants.js:20 Size in bytes (4 bytes for Uint32)constSIZE:4=4
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
Uint32
Defined in: src/primitives/Uint32/index.ts:82constUint32:object
Type Declaration
bitLength()
bitLength: (Calculate bit length of Uint32 valueuint) =>number
Parameters
uint
Uint32Type
Value
Returns
number
Number of bits needed to represent value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseAnd()
bitwiseAnd: (Bitwise AND Uint32 valuesuint,b) =>Uint32Type
Parameters
uint
Uint32Type
First operand
b
Uint32Type
Second operand
Returns
Uint32Type
Result (uint & b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseNot()
bitwiseNot: (Bitwise NOT Uint32 valueuint) =>Uint32Type
Parameters
uint
Uint32Type
Operand
Returns
Uint32Type
Result (~uint)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseOr()
bitwiseOr: (Bitwise OR Uint32 valuesuint,b) =>Uint32Type
Parameters
uint
Uint32Type
First operand
b
Uint32Type
Second operand
Returns
Uint32Type
Result (uint | b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseXor()
bitwiseXor: (Bitwise XOR Uint32 valuesuint,b) =>Uint32Type
Parameters
uint
Uint32Type
First operand
b
Uint32Type
Second operand
Returns
Uint32Type
Result (uint ^ b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
clone()
clone: (Clone Uint32 valueuint) =>Uint32Type
Parameters
uint
Uint32Type
Value to clone
Returns
Uint32Type
Cloned value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
dividedBy()
dividedBy: (Divide Uint32 value (integer division)uint,b) =>Uint32Type
Parameters
uint
Uint32Type
Dividend
b
Uint32Type
Divisor
Returns
Uint32Type
Quotient (uint / b) truncated
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If divisor is zeroExample
equals()
equals: (Check if Uint32 values are equaluint,b) =>boolean
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
boolean
true if equal
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
from()
from: (Create Uint32 from number, bigint, or stringvalue) =>Uint32Type
Parameters
value
number, bigint, or decimal/hex stringstring | number | bigint
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of range or invalidExample
fromAbiEncoded()
fromAbiEncoded: (Create Uint32 from ABI-encoded bytes (32 bytes, big-endian, left-padded)bytes) =>Uint32Type
Parameters
bytes
Uint8Array<ArrayBufferLike>
ABI-encoded byte array (32 bytes)
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If bytes length is not 32Example
fromBigInt()
fromBigInt: (Create Uint32 from bigintvalue) =>Uint32Type
Parameters
value
bigint
bigint value
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of rangeExample
fromBytes()
fromBytes: (Create Uint32 from bytes (big-endian, 4 bytes)bytes) =>Uint32Type
Parameters
bytes
Uint8Array<ArrayBufferLike>
byte array (must be exactly 4 bytes)
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If bytes length is not 4Example
fromHex()
fromHex: (Create Uint32 from hex stringhex) =>Uint32Type
Parameters
hex
string
hex string (with or without 0x prefix)
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of range or invalid hexExample
fromNumber()
fromNumber: (Create Uint32 from numbervalue) =>Uint32Type
Parameters
value
number
number value
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of range or invalidExample
greaterThan()
greaterThan: (Check if Uint32 value is greater than anotheruint,b) =>boolean
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
boolean
true if uint > b
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
isValid()
isValid: (Check if value is a valid Uint32value) =>value is Uint32Type
Parameters
value
unknown
Value to check
Returns
value is Uint32Type
true if valid Uint32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
isZero()
isZero: (Check if Uint32 value is zerouint) =>boolean
Parameters
uint
Uint32Type
Value to check
Returns
boolean
true if zero
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
leadingZeros()
leadingZeros: (Count leading zeros in Uint32 valueuint) =>number
Parameters
uint
Uint32Type
Value
Returns
number
Number of leading zero bits
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
lessThan()
lessThan: (Check if Uint32 value is less than anotheruint,b) =>boolean
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
boolean
true if uint < b
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
MAX
MAX: Uint32Type
Maximum Uint32 value: 2^32 - 1 = 4294967295
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
maximum()
maximum: (Return maximum of two Uint32 valuesuint,b) =>Uint32Type
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
Uint32Type
Maximum value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
MIN
MIN: Uint32Type
Minimum Uint32 value: 0
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
minimum()
minimum: (Return minimum of two Uint32 valuesuint,b) =>Uint32Type
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
Uint32Type
Minimum value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
minus()
minus: (Subtract Uint32 value with wrappinguint,b) =>Uint32Type
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 documentationSince
0.0.0Throws
Example
modulo()
modulo: (Modulo Uint32 valueuint,b) =>Uint32Type
Parameters
uint
Uint32Type
Dividend
b
Uint32Type
Divisor
Returns
Uint32Type
Remainder (uint % b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If divisor is zeroExample
ONE
ONE: Uint32Type
One value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
plus()
plus: (Add Uint32 value with wrappinguint,b) =>Uint32Type
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 documentationSince
0.0.0Throws
Example
popCount()
popCount: (Count set bits (population count) in Uint32 valueuint) =>number
Parameters
uint
Uint32Type
Value
Returns
number
Number of set bits
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
shiftLeft()
shiftLeft: (Left shift Uint32 valueuint,bits) =>Uint32Type
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 documentationSince
0.0.0Throws
Example
shiftRight()
shiftRight: (Right shift Uint32 value (logical shift, zero-fill)uint,bits) =>Uint32Type
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 documentationSince
0.0.0Throws
Example
SIZE
SIZE: 4
Size in bytes (4 bytes for Uint32)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
times()
times: (Multiply Uint32 value with wrappinguint,b) =>Uint32Type
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 documentationSince
0.0.0Throws
Example
toAbiEncoded()
toAbiEncoded: (Convert Uint32 to ABI-encoded bytes (32 bytes, big-endian, left-padded with zeros)uint) =>Uint8Array<ArrayBufferLike>
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
Uint8Array<ArrayBufferLike>
32-byte Uint8Array
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toBigInt()
toBigInt: (Convert Uint32 to bigintuint) =>bigint
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
bigint
bigint value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toBytes()
toBytes: (Convert Uint32 to bytes (big-endian, 4 bytes)uint) =>Uint8Array<ArrayBufferLike>
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
Uint8Array<ArrayBufferLike>
4-byte Uint8Array
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toHex()
toHex: (Convert Uint32 to hex string (with 0x prefix)uint) =>string
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
string
hex string with 0x prefix
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toNumber()
toNumber: (Convert Uint32 to numberuint) =>number
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
number
number value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toPower()
toPower: (Raise Uint32 to power with wrappinguint,exp) =>Uint32Type
Parameters
uint
Uint32Type
Base
exp
Uint32Type
Exponent
Returns
Uint32Type
Result (uint ^ exp) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toString()
toString: (Convert Uint32 to stringuint) =>string
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
string
decimal string representation
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
tryFrom()
tryFrom: (Try to create Uint32 from value, return null if invalidvalue) =>Uint32Type|null
Parameters
value
unknown
Value to convert
Returns
Uint32Type | null
Uint32 value or null
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
ZERO
ZERO: Uint32Type
Zero value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
ZERO
Defined in: src/primitives/Uint32/constants.js:64 Zero valueconstZERO:Uint32Type
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Example
Functions
bitLength()
bitLength(Defined in: src/primitives/Uint32/bitLength.js:16 Calculate bit length of Uint32 valueuint):number
Parameters
uint
Uint32Type
Value
Returns
number
Number of bits needed to represent value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseAnd()
bitwiseAnd(Defined in: src/primitives/Uint32/bitwiseAnd.js:18 Bitwise AND Uint32 valuesuint,b):Uint32Type
Parameters
uint
Uint32Type
First operand
b
Uint32Type
Second operand
Returns
Uint32Type
Result (uint & b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseNot()
bitwiseNot(Defined in: src/primitives/Uint32/bitwiseNot.js:16 Bitwise NOT Uint32 valueuint):Uint32Type
Parameters
uint
Uint32Type
Operand
Returns
Uint32Type
Result (~uint)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseOr()
bitwiseOr(Defined in: src/primitives/Uint32/bitwiseOr.js:18 Bitwise OR Uint32 valuesuint,b):Uint32Type
Parameters
uint
Uint32Type
First operand
b
Uint32Type
Second operand
Returns
Uint32Type
Result (uint | b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
bitwiseXor()
bitwiseXor(Defined in: src/primitives/Uint32/bitwiseXor.js:18 Bitwise XOR Uint32 valuesuint,b):Uint32Type
Parameters
uint
Uint32Type
First operand
b
Uint32Type
Second operand
Returns
Uint32Type
Result (uint ^ b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
clone()
clone(Defined in: src/primitives/Uint32/clone.js:16 Clone Uint32 valueuint):Uint32Type
Parameters
uint
Uint32Type
Value to clone
Returns
Uint32Type
Cloned value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
dividedBy()
dividedBy(Defined in: src/primitives/Uint32/dividedBy.js:18 Divide Uint32 value (integer division)uint,b):Uint32Type
Parameters
uint
Uint32Type
Dividend
b
Uint32Type
Divisor
Returns
Uint32Type
Quotient (uint / b) truncated
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If divisor is zeroExample
equals()
equals(Defined in: src/primitives/Uint32/equals.js:18 Check if Uint32 values are equaluint,b):boolean
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
boolean
true if equal
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
from()
from(Defined in: src/primitives/Uint32/from.js:20 Create Uint32 from number, bigint, or stringvalue):Uint32Type
Parameters
value
number, bigint, or decimal/hex stringstring | number | bigint
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of range or invalidExample
fromAbiEncoded()
fromAbiEncoded(Defined in: src/primitives/Uint32/fromAbiEncoded.js:17 Create Uint32 from ABI-encoded bytes (32 bytes, big-endian, left-padded)bytes):Uint32Type
Parameters
bytes
Uint8Array<ArrayBufferLike>
ABI-encoded byte array (32 bytes)
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If bytes length is not 32Example
fromBigInt()
fromBigInt(Defined in: src/primitives/Uint32/fromBigInt.js:17 Create Uint32 from bigintvalue):Uint32Type
Parameters
value
bigint
bigint value
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of rangeExample
fromBytes()
fromBytes(Defined in: src/primitives/Uint32/fromBytes.js:18 Create Uint32 from bytes (big-endian, 4 bytes)bytes):Uint32Type
Parameters
bytes
Uint8Array<ArrayBufferLike>
byte array (must be exactly 4 bytes)
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If bytes length is not 4Example
fromHex()
fromHex(Defined in: src/primitives/Uint32/fromHex.js:18 Create Uint32 from hex stringhex):Uint32Type
Parameters
hex
string
hex string (with or without 0x prefix)
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of range or invalid hexExample
fromNumber()
fromNumber(Defined in: src/primitives/Uint32/fromNumber.js:17 Create Uint32 from numbervalue):Uint32Type
Parameters
value
number
number value
Returns
Uint32Type
Uint32 value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If value is out of range or invalidExample
greaterThan()
greaterThan(Defined in: src/primitives/Uint32/greaterThan.js:18 Check if Uint32 value is greater than anotheruint,b):boolean
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
boolean
true if uint > b
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
isValid()
isValid(Defined in: src/primitives/Uint32/isValid.js:19 Check if value is a valid Uint32value):value is Uint32Type
Parameters
value
unknown
Value to check
Returns
value is Uint32Type
true if valid Uint32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
isZero()
isZero(Defined in: src/primitives/Uint32/isZero.js:16 Check if Uint32 value is zerouint):boolean
Parameters
uint
Uint32Type
Value to check
Returns
boolean
true if zero
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
leadingZeros()
leadingZeros(Defined in: src/primitives/Uint32/leadingZeros.js:16 Count leading zeros in Uint32 valueuint):number
Parameters
uint
Uint32Type
Value
Returns
number
Number of leading zero bits
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
lessThan()
lessThan(Defined in: src/primitives/Uint32/lessThan.js:18 Check if Uint32 value is less than anotheruint,b):boolean
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
boolean
true if uint < b
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
maximum()
maximum(Defined in: src/primitives/Uint32/maximum.js:18 Return maximum of two Uint32 valuesuint,b):Uint32Type
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
Uint32Type
Maximum value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
minimum()
minimum(Defined in: src/primitives/Uint32/minimum.js:18 Return minimum of two Uint32 valuesuint,b):Uint32Type
Parameters
uint
Uint32Type
First value
b
Uint32Type
Second value
Returns
Uint32Type
Minimum value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
minus()
minus(Defined in: src/primitives/Uint32/minus.js:18 Subtract Uint32 value with wrappinguint,b):Uint32Type
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 documentationSince
0.0.0Throws
Example
modulo()
modulo(Defined in: src/primitives/Uint32/modulo.js:18 Modulo Uint32 valueuint,b):Uint32Type
Parameters
uint
Uint32Type
Dividend
b
Uint32Type
Divisor
Returns
Uint32Type
Remainder (uint % b)
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
If divisor is zeroExample
plus()
plus(Defined in: src/primitives/Uint32/plus.js:18 Add Uint32 value with wrappinguint,b):Uint32Type
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 documentationSince
0.0.0Throws
Example
popCount()
popCount(Defined in: src/primitives/Uint32/popCount.js:16 Count set bits (population count) in Uint32 valueuint):number
Parameters
uint
Uint32Type
Value
Returns
number
Number of set bits
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
shiftLeft()
shiftLeft(Defined in: src/primitives/Uint32/shiftLeft.js:17 Left shift Uint32 valueuint,bits):Uint32Type
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 documentationSince
0.0.0Throws
Example
shiftRight()
shiftRight(Defined in: src/primitives/Uint32/shiftRight.js:17 Right shift Uint32 value (logical shift, zero-fill)uint,bits):Uint32Type
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 documentationSince
0.0.0Throws
Example
times()
times(Defined in: src/primitives/Uint32/times.js:18 Multiply Uint32 value with wrappinguint,b):Uint32Type
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 documentationSince
0.0.0Throws
Example
toAbiEncoded()
toAbiEncoded(Defined in: src/primitives/Uint32/toAbiEncoded.js:16 Convert Uint32 to ABI-encoded bytes (32 bytes, big-endian, left-padded with zeros)uint):Uint8Array<ArrayBufferLike>
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
Uint8Array<ArrayBufferLike>
32-byte Uint8Array
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toBigInt()
toBigInt(Defined in: src/primitives/Uint32/toBigInt.js:16 Convert Uint32 to bigintuint):bigint
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
bigint
bigint value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toBytes()
toBytes(Defined in: src/primitives/Uint32/toBytes.js:18 Convert Uint32 to bytes (big-endian, 4 bytes)uint):Uint8Array<ArrayBufferLike>
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
Uint8Array<ArrayBufferLike>
4-byte Uint8Array
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toHex()
toHex(Defined in: src/primitives/Uint32/toHex.js:16 Convert Uint32 to hex string (with 0x prefix)uint):string
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
string
hex string with 0x prefix
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toNumber()
toNumber(Defined in: src/primitives/Uint32/toNumber.js:16 Convert Uint32 to numberuint):number
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
number
number value
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toPower()
toPower(Defined in: src/primitives/Uint32/toPower.js:18 Raise Uint32 to power with wrappinguint,exp):Uint32Type
Parameters
uint
Uint32Type
Base
exp
Uint32Type
Exponent
Returns
Uint32Type
Result (uint ^ exp) mod 2^32
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
toString()
toString(Defined in: src/primitives/Uint32/toString.js:17 Convert Uint32 to stringuint):string
Parameters
uint
Uint32Type
Uint32 value to convert
Returns
string
decimal string representation
See
https://voltaire.tevm.sh/primitives/uint32 for Uint32 documentationSince
0.0.0Throws
Example
tryFrom()
tryFrom(Defined in: src/primitives/Uint32/tryFrom.js:19 Try to create Uint32 from value, return null if invalidvalue):Uint32Type|null
Parameters
value
unknown
Value to convert
Returns
Uint32Type | null
Uint32 value or null

