Web3JS Online
Viem Online
Webhooks, Alerts, and a simple API.
The sha3Raw function is a utility method provided by the web3.utils module that calculates the Keccak-256 hash of the input data and returns the hash value as a string. Unlike the sha3 function, sha3Raw will always return a string value, even if the input data is an empty string or a buffer of zero length.
The function takes a single parameter:
The sha3Raw function returns a 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 a string value that is not undefined.
Here's an example of how the sha3Raw function can be used:
In this example, the sha3Raw function is called with a string data and an empty string emptyData. The function returns a string representation of the Keccak-256 hash of the input data for both calls, with the hash value being different for each input.