Possible to compute SHA256 hash of large request body?

Looks like they just added crypto.DigestStream in the latest Workers Runtime update to solve this exact problem.

Thanks to the Workers team for addressing this!

  • crypto.DigestStream is a non-standard extension to the crypto API that supports generating a hash digest from streaming data. The DigestStream itself is a WritableStream that does not retain the data written into it; instead, it generates a digest hash automatically when the flow of data has ended. The same hash algorithms supported by crypto.subtle.digest() are supported by the crypto.DigestStream.