Polkadot Apps
    Preparing search index...
    • Compute a 32-byte Keccak-256 hash.

      Used for Ethereum-compatible operations (address derivation, EVM function selectors) and supported by the Bulletin Chain for cross-chain compatibility.

      Parameters

      • data: Uint8Array

        Arbitrary bytes to hash.

      Returns Uint8Array

      32-byte Keccak-256 digest.

      import { keccak256, bytesToHex } from "@polkadot-apps/utils";

      const hash = keccak256(new TextEncoder().encode("hello"));
      console.log(bytesToHex(hash)); // 64-char hex string