@profullstack/threatcrush 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11256,7 +11256,14 @@ function meetsFailThreshold(findings, threshold) {
11256
11256
  }
11257
11257
 
11258
11258
  // src/scan/sarif.ts
11259
+ var import_node_crypto = require("crypto");
11259
11260
  var import_node_path4 = require("path");
11261
+ function fingerprintOf(finding) {
11262
+ const content = finding.excerpt.replace(/\s+/g, " ").trim();
11263
+ return (0, import_node_crypto.createHash)("sha256").update(`${finding.ruleId}
11264
+ ${finding.file}
11265
+ ${content}`).digest("hex").slice(0, 32);
11266
+ }
11260
11267
  var SARIF_VERSION = "2.1.0";
11261
11268
  var SARIF_SCHEMA = "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json";
11262
11269
  function sarifLevel(severity) {
@@ -11349,7 +11356,7 @@ ${finding.consequence}` : `**${finding.title}**`
11349
11356
  }
11350
11357
  ],
11351
11358
  partialFingerprints: {
11352
- primaryLocationLineHash: `${finding.ruleId}:${finding.file}:${Math.max(1, finding.line)}`
11359
+ primaryLocationLineHash: fingerprintOf(finding)
11353
11360
  },
11354
11361
  properties: {
11355
11362
  severity: finding.severity,