UNPKG

@aws-crypto/sha256-browser

Version:

SHA256 wrapper for browsers that prefers `window.crypto.subtle` but will fall back to a pure JS implementation in @aws-crypto/sha256-js to provide a consistent interface for SHA256.

10 lines (7 loc) 206 B
import { SourceData } from "@aws-sdk/types"; export function isEmptyData(data: SourceData): boolean { if (typeof data === "string") { return data.length === 0; } return data.byteLength === 0; }