Private hash
Wander Injected API privateHash() function
Last updated
Was this helpful?
Wander Injected API privateHash() function
Last updated
Was this helpful?
The privateHash()
function allows you to create deterministic secrets (hashes) from some data.
data
ArrayBuffer
The data to hash
options
Configuration for the hash
// connect to the extension
await window.arweaveWallet.connect(["SIGNATURE"]);
// data to be hashed
const data = new TextEncoder().encode("The hash of this msg will be signed.");
// create the hash using the active wallet
const hash = await window.arweaveWallet.privateHash(
data,
{ hashAlgorithm: "SHA-256" }
);
console.log("Data hash is", hash);