The library now uses WebCrypto API instead of node:crypto, so it can run in non-Node.js environments as well.
Breaking changes
- The package build is now ESM-only, not CommonJS.
createContentDigestHeaderandverifyContentDigestare now async, returningPromise<string>/Promise<boolean>respectively, instead ofstring/boolean.DigestAlgorithmvalues changed from lowercase to Web Crypto identifiers: pass'SHA-256'/'SHA-512'instead of'sha-256'/'sha-512'- The message body no longer accepts
undefined. Pass''(or an empty buffer) for an empty body.. - Dropped
Bufferfrom the public type signature. Node'sBufferstill works as a body value at runtime, but the library itself carries no Node-specific dependency anymore.
Other changes
- Update
structured-headerslibrary to v2 - Removed multiple dev-dependencies and modernized codebase.
Full Changelog: eb2e41c...v2.0.0