Ens.namehash
Hashes ENS name.
Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to normalize ENS names with UTS-46 normalization before passing them to namehash. You can use the built-in Ens.normalize function for this.
Imports
Named
import { Ens } from 'ox'Examples
import { Ens } from 'ox'
Ens.namehash('wevm.eth')
'0x08c85f2f4059e930c45a6aeff9dcd3bd95dc3c5c1cddef6a0626b31152248560'Definition
function namehash(
name: string,
): `0x${string}`Source: src/core/Ens.ts
Parameters
name
- Type:
string
ENS name.
Return Type
ENS namehash.
0x${string}

