Web3JS Online
Viem Online
Webhooks, Alerts, and a simple API.
The soliditySha3 function is a utility method provided by the web3.utils module that takes an array of Sha3Input objects and returns a string representing the Keccak-256 hash of the tightly packed values. The function is designed to work in a way that is similar to how Solidity, a popular smart contract programming language, would pack and hash data.
The function takes a variable number of Sha3Input objects as arguments, which are used to specify the input data to be hashed. Each Sha3Input object should have a type property that specifies the type of data being input (e.g. "string", "number", etc.), and a value property that specifies the actual input data.
The soliditySha3 function returns a string representing the Keccak-256 hash of the tightly packed values, or undefined if the input array is empty.
Here's an example of how the soliditySha3 function can be used:
In this example, the soliditySha3 function is called with a single Sha3Input object that specifies a string input value. The function returns a string representing the Keccak-256 hash of the tightly packed input value.