Try it Live
Run Uint examples in the interactive playground
- Effect Schema
Input Types
Uint.from accepts multiple input types for flexibility:
BigInt (JavaScript)
Number (JavaScript)
String - Decimal
String - Hexadecimal
Hex strings with or without0x prefix:
Validation
All inputs validated before construction: Range checks:Usage Patterns
Constructor Selection
Safe Parsing
Type Conversion
Performance
Zero-copy for direct Uint8Array construction (fromBytes, fromAbiEncoded). Conversion required for strings (parses and allocates new Uint8Array). For performance-critical code, prefer passing bigint directly or using fromBytes.See Also
- tryFrom - Safe constructor (no throw)
- fromHex - Parse hex string
- fromBigInt - From BigInt
- fromNumber - From number
- fromBytes - From byte array
- fromAbiEncoded - From ABI bytes

