Skip to content

CNS

Modules:

Name Description
core

Classes:

Name Description
CNSDomain

CNSDomain

Methods:

Name Description
namehash_dome

ENS "namehash()" convention mapping of strings to bytes(32) hashes.

namehash_hashlib

ENS "namehash()" convention mapping of strings to bytes(32) hashes.

namehash_dome(name, encoding='utf-8')

ENS "namehash()" convention mapping of strings to bytes(32) hashes.

Recursive function variant. Performs slightly better than the generator-based variant, but can't handle names with infinite (or extremely large) number of labels.

:param name: name to hash, labels separated by dots :type name: str :returns: bytes(32)

namehash_hashlib(name, encoding='utf-8')

ENS "namehash()" convention mapping of strings to bytes(32) hashes.

Recursive function variant. Performs slightly better than the generator-based variant, but can't handle names with infinite (or extremely large) number of labels.

:param name: name to hash, labels separated by dots :type name: str :returns: bytes(32)