"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createHash = createHash;

function createHash({
  compiler,
  outputOptions,
  content
}) {
  const {
    hashFunction,
    hashDigest,
    hashDigestLength
  } = outputOptions;
  const {
    createHash
  } = compiler.webpack.util;
  const hash = createHash(hashFunction);
  hash.update(content);
  return hash.digest(hashDigest).substring(0, hashDigestLength);
}