1/**2 * Computes the SHA-256 digest of bytes using the Web Crypto API.3 *4 * @param bytes Bytes to hash.5 * @returns The 32-byte digest encoded as 64 lowercase hexadecimal characters.6 */7export async function sha256hex(bytes: Uint8Array): Promise<string> {8 const digest = await crypto.subtle.digest("SHA-256", bytes as BufferSource);9 return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0"))10 .join("");11}