<commit_before>
var fs = require("./graceful-fs")
  , crypto = require("crypto")
  , log = require("./log")
  , binding

try { binding = process.binding("crypto") }
catch (e) { binding = null }

exports.check = check
exports.get = get

function check (file, sum, cb) {
  if (!binding) {
    log.warn("OpenSSL binding not found. Cannot verify shasum.", "shasum")
    return cb()
  }
  get(file, function (er, actual) {
    if (er) return log.er(cb, "Error getting shasum")(er)
    var expected = sum.toLowerCase().trim()
      , ok = actual === expected
    cb(ok ? null : new Error(
      "shasum check failed for "+file+"\n"
      +"Expected: "+expected+"\n"
      +"Actual:   "+actual))
  })
}
function get (file, cb) {
  if (!binding) {
    log.warn("OpenSSL binding not found. Cannot verify shasum.", "shasum")
    return cb()
  }
  log(file, "calculating sha1")
  var h = crypto.createHash("sha1")
    , s = fs.createReadStream(file)
    , errState = null<commit_msg>Warn about "crypto", not "OpenSSL"<commit_after>
var fs = require("./graceful-fs")
  , crypto = require("crypto")
  , log = require("./log")
  , binding

try { binding = process.binding("crypto") }
catch (e) { binding = null }

exports.check = check
exports.get = get

function check (file, sum, cb) {
  if (!binding) {
    log.warn("crypto binding not found. Cannot verify shasum.", "shasum")
    return cb()
  }
  get(file, function (er, actual) {
    if (er) return log.er(cb, "Error getting shasum")(er)
    var expected = sum.toLowerCase().trim()
      , ok = actual === expected
    cb(ok ? null : new Error(
      "shasum check failed for "+file+"\n"
      +"Expected: "+expected+"\n"
      +"Actual:   "+actual))
  })
}
function get (file, cb) {
  if (!binding) {
    log.warn("crypto binding not found. Cannot verify shasum.", "shasum")
    return cb()
  }
  log(file, "calculating sha1")
  var h = crypto.createHash("sha1")
    , s = fs.createReadStream(file)
    , errState = null
{'fraction_non_alphanumeric': 0.16760061130922058, 'fraction_numerical': 0.0020376974019358125, 'mean_word_length': 3.1522198731501057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2921809', 'n_tokens_mistral': 676, 'n_tokens_neox': 670, 'n_words': 193}