Web3JS Online
Viem Online
Webhooks, Alerts, and a simple API.
The soliditySha3Raw function is a utility method provided by the web3.utils module that takes an array of TypedObject or TypedObjectAbbreviated 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 TypedObject or TypedObjectAbbreviated objects as arguments, which are used to specify the input data to be hashed. Each 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 soliditySha3Raw function returns a string representing the Keccak-256 hash of the tightly packed values, or a fixed string value 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 if the input array is empty.
Here's an example of how the soliditySha3Raw function can be used:
In this example, the soliditySha3Raw function is called with a single TypedObject object that specifies a string input value. The function returns a string representing the Keccak-256 hash of the tightly packed input value.