Skip to content

Commit 3fffb0d

Browse files
committed
use eth-hash instead of pysha3
1 parent 04d9b8b commit 3fffb0d

3 files changed

Lines changed: 14 additions & 33 deletions

File tree

poetry.lock

Lines changed: 11 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ include = ["CHANGES.md", "docs/*", "docs/validators.1", "validators/py.typed"]
4949

5050
[tool.poetry.dependencies]
5151
python = "^3.8"
52+
eth-hash = "^0.5.2"
5253

5354
[tool.poetry.group.docs]
5455
optional = true

validators/crypto_addresses/eth_address.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# standard
55
import re
66

7-
from sha3 import keccak_256
7+
from eth_hash.auto import keccak
88

99
# local
1010
from validators.utils import validator
@@ -13,7 +13,7 @@
1313
def _validate_eth_checksum_address(addr: str):
1414
"""Validate ETH type checksum address."""
1515
addr = addr.replace("0x", "")
16-
addr_hash = keccak_256(addr.lower().encode("ascii")).hexdigest()
16+
addr_hash = keccak.new(addr.lower().encode("ascii")).digest().hex()
1717

1818
if len(addr) != 40:
1919
return False

0 commit comments

Comments
 (0)