UNPKG

@hashgraph/cryptography

Version:

Cryptographic utilities and primitives for the Hiero SDK

12 lines (10 loc) 353 B
import crypto from "crypto"; /** * @param {Uint8Array} data * @returns {Promise<Uint8Array>} */ // eslint-disable-next-line @typescript-eslint/require-await export async function digest(data) { // fallback to trying node-crypto which could be polyfilled by the browser environment return crypto.createHash("sha256").update(data).digest(); }