slither.utils.function

 1from Crypto.Hash import keccak
 2
 3
 4def get_function_id(sig: str) -> int:
 5    """'
 6        Return the function id of the given signature
 7    Args:
 8        sig (str)
 9    Return:
10        (int)
11    """
12    digest = keccak.new(digest_bits=256)
13    digest.update(sig.encode("utf-8"))
14    return int("0x" + digest.hexdigest()[:8], 16)
def get_function_id(sig: str) -> int:
 5def get_function_id(sig: str) -> int:
 6    """'
 7        Return the function id of the given signature
 8    Args:
 9        sig (str)
10    Return:
11        (int)
12    """
13    digest = keccak.new(digest_bits=256)
14    digest.update(sig.encode("utf-8"))
15    return int("0x" + digest.hexdigest()[:8], 16)

' Return the function id of the given signature Args: sig (str) Return: (int)