Schemas
| Schema | Input | Output |
|---|---|---|
Hash.Hex | hex string | HashType |
Hash.Bytes | Uint8Array | HashType |
Constructors (Effect)
| Function | Input | Description |
|---|---|---|
from(value) | string | Uint8Array | Create from hex or bytes |
fromHex(hex) | string | Create from 66-char hex string |
fromBytes(bytes) | Uint8Array | Create from 32-byte array |
Validation
| Function | Description |
|---|---|
isHash(value) | Type guard (pure sync) |
isValidHex(hex) | Check if hex is valid hash format |
isZero(hash) | Check if hash is all zeros |
assert(hash) | Assert value is valid hash |
Operations (Effect)
| Function | Description |
|---|---|
clone(hash) | Create independent copy |
concat(...hashes) | Concatenate and hash |
equals(a, b) | Compare two hashes |
slice(hash, start?, end?) | Extract byte range |
Conversions
| Function | Description |
|---|---|
toHex(hash) | Convert to hex string (pure sync) |
toBytes(hash) | Convert to Uint8Array (pure sync) |
toString(hash) | Same as toHex (Effect) |
format(hash) | Format for display (Effect) |
Crypto (Effect)
| Function | Description |
|---|---|
keccak256(data) | Hash bytes |
keccak256Hex(hex) | Hash hex string |
keccak256String(str) | Hash UTF-8 string |
merkleRoot(leaves) | Compute merkle root |
random() | Generate random hash |
Common Uses
- Transaction hashes (
eth_getTransactionByHash) - Block hashes (
eth_getBlockByHash) - State roots, receipts roots, transactions roots
- Storage slots
See Also
- TransactionHash — Transaction hash type
- BlockHash — Block hash type
- Keccak256 — Compute hashes
- Voltaire Hash — Core Hash documentation
- Effect Schema — Effect Schema validation

