Web3JS Online
Viem Online
Webhooks, Alerts, and a simple API.
The sha3 function is a utility method provided by the web3.utils module that computes the Keccak-256 hash of the input data and returns a hexadecimal string representation of the hash.
The function takes a single parameter:data : which is the input data to be hashed. The data parameter can be a string or a buffer of bytes.
The sha3 function returns a hexadecimal string representation of the Keccak-256 hash of the input data. If the input data is an empty string or a buffer of zero length, the function returns undefined.
Here's an example of how the sha3 function can be used:
In this example, the sha3 function is called with a string data and an empty string emptyData. The function returns a hexadecimal string representation of the Keccak-256 hash of the input data for the first call, and undefined for the second call since the input data is empty.