Try it Live
Run Uint examples in the interactive playground
- Effect Schema
Hex String Format
Hex strings represent unsigned integers in hexadecimal (base 16).Valid Formats
Prefix Handling
The0x prefix is optional:
Case Insensitivity
Length and Range
Maximum Length
Hex strings for Uint256 can have up to 64 hex digits (not including0x prefix):
Minimum Length
No minimum - leading zeros are implicit:Common Values
Powers of 2
Common Ethereum Values
Error Handling
Invalid Characters
Overflow
Empty String
Usage Patterns
Parsing Ethereum Data
Converting from Other Primitives
Safe Parsing
Performance
Hex parsing requires:- Character validation (each char must be 0-9, a-f, A-F)
- Conversion to bytes
- BigInt construction
fromBytesif you already have Uint8Arrayfrom(bigint)if you already have BigInt
See Also
- from - Universal constructor
- toHex - Convert to hex string
- fromBytes - From byte array
- Hex primitive - Hex string utilities

