Packages

ssri

14.0.0 · 8 May 2026ISC47.5M / weekRepositoryHomepagenpmAtom feed

Your version

3.0.0

major3 Apr 2017Where it was published

3.0.2 is the newest release of 3.x.

In short

3 breaking9 new1 fixed

  • Breaking

    hashes: .isIntegrityMetadata is now .isHash. Also, any references to IntegrityMetadata now refer to Hash.

  • Breaking

    integrityStream: createCheckerStream has been removed and replaced with a general-purpose integrityStream.

  • Breaking

    check: checkData, checkStream, and createCheckerStream now yield a whole IntegrityMetadata instance representing the first successful hash match.

Security

1 advisory affects 3.0.0; 5.2.2 fixes them

Release note

Bug Fixes

  • hashes: IntegrityMetadata -> Hash

Features

  • check: return IntegrityMetadata on check success

  • fromHex: ssri.fromHex to make it easier to generate them from hex valus

  • hex: utility function for getting hex version of digest

  • hexDigest: added hexDigest method to Integrity objects too

  • integrity: add .isIntegrity and .isIntegrityMetadata

  • integrityStream: new stream that can both generate and check streamed data

  • parse: allow parsing straight into a single IntegrityMetadata object

  • pickAlgorithm: Intergrity#pickAlgorithm() added

  • size: calculate and update stream sizes

Breaking changes

  • Breaking

    hashes: .isIntegrityMetadata is now .isHash. Also, any references to IntegrityMetadata now refer to Hash.

  • Breaking

    integrityStream: createCheckerStream has been removed and replaced with a general-purpose integrityStream.

To convert existing createCheckerStream code, move the sri argument into opts.integrity in integrityStream. All other options should be the same.

  • Breaking

    check: checkData, checkStream, and createCheckerStream now yield a whole IntegrityMetadata instance representing the first successful hash match.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.