web3
web3_sha3
Returns the Keccak-256 hash of the given data. This is the hashing algorithm used throughout Ethereum and PulseChain (often referred to as SHA3).
Returns the Keccak-256 hash of the given data. This is the hashing algorithm used throughout Ethereum and PulseChain (often referred to as SHA3).
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | Hex-encoded data to hash. |
Returns
| Type | Description |
|---|---|
string | The Keccak-256 hash of the input data, hex-encoded with 0x prefix. |
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "web3_sha3",
"params": ["0x68656c6c6f"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8"
}
TRY IT
Notes
- The input
0x68656c6c6fis the hex encoding of the string"hello". - Despite the name
sha3, this uses Keccak-256, which differs slightly from the NIST SHA-3 standard. - The input must be hex-encoded with a
0xprefix.
