@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
13 lines • 450 B
JavaScript
import { subtle } from "uncrypto";
/**
* Auth-specific hash function using uncrypto for Edge runtime compatibility.
* Computes SHA-256 hash of the given data.
*
* @param data - The data to hash
* @returns Promise that resolves to the hex-encoded hash
*/
export const authHash = async (data) => {
const hashBuffer = await subtle.digest("SHA-256", data);
return Buffer.from(hashBuffer).toString("hex");
};
//# sourceMappingURL=hash.js.map