Skip to content

v2.0.0

Latest

Choose a tag to compare

@sidvishnoi sidvishnoi released this 14 Sep 13:04
040d1bd

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.
  • createContentDigestHeader and verifyContentDigest are now async, returning Promise<string> / Promise<boolean> respectively, instead of string / boolean.
  • DigestAlgorithm values 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 Buffer from the public type signature. Node's Buffer still works as a body value at runtime, but the library itself carries no Node-specific dependency anymore.

Other changes

  • Update structured-headers library to v2
  • Removed multiple dev-dependencies and modernized codebase.

Full Changelog: eb2e41c...v2.0.0