Compute a 32-byte SHA2-256 hash.
Used by bulletin-deploy and supported by the Bulletin Chain as an alternative hashing algorithm.
Arbitrary bytes to hash.
32-byte SHA2-256 digest.
import { sha256, bytesToHex } from "@polkadot-apps/utils";const hash = sha256(new TextEncoder().encode("hello"));console.log(bytesToHex(hash)); // 64-char hex string Copy
import { sha256, bytesToHex } from "@polkadot-apps/utils";const hash = sha256(new TextEncoder().encode("hello"));console.log(bytesToHex(hash)); // 64-char hex string
Compute a 32-byte SHA2-256 hash.
Used by bulletin-deploy and supported by the Bulletin Chain as an alternative hashing algorithm.