Skip to content

Commit

Permalink
Deprecate the keccak function
Browse files Browse the repository at this point in the history
It just added support for text/hex to eth_hash's version, but that has a
significant performance impact and was not really used anywhere, so
deprecating it now so that it can be removed in a future version.

Closes: ethereum#95
  • Loading branch information
gsalgado committed Apr 30, 2018
1 parent ec95da3 commit c8fa6fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eth_utils/crypto.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import warnings

from eth_hash.auto import keccak as keccak_256

from .conversions import (
Expand All @@ -6,4 +8,7 @@


def keccak(primitive=None, hexstr=None, text=None):
warnings.warn(DeprecationWarning(
"The `eth_utils.keccak()` function has been deprecated and will be removed in a "
"future version. You should update your code to use eth_hash.auto.keccak instead."))
return keccak_256(to_bytes(primitive, hexstr, text))

0 comments on commit c8fa6fc

Please sign in to comment.