UNPKG

@baqhub/sdk

Version:

The official JavaScript SDK for the BAQ federated app platform.

13 lines (12 loc) 332 B
import { sha256 } from "@noble/hashes/sha256"; import { bytesToHex } from "@noble/hashes/utils"; function hashString(value) { return bytesToHex(sha256(value)); } function shortHashString(value) { return bytesToHex(sha256(value).slice(0, 16)); } export const Hash = { hash: hashString, shortHash: shortHashString, };