index.js
function _createHash(aBufferList, { HASH_TYPE, DIGEST_TYPE, MAX_LENGTH }) {
  // very important to sort buffer list before creating hash!!
  const aSortedBufferList = (aBufferList || []).sort()

  // create and return hash
  return aSortedBufferList.length > 0
    ? loaderUtils
        .getHashDigest(
          Buffer.concat(aSortedBufferList),
          HASH_TYPE,
          DIGEST_TYPE,
          MAX_LENGTH
        )
        // Windows machines are case insensitive while Linux machines are, so we only will use lower case paths
        .toLowerCase()
    : null
}
function _createHash(aBufferList, { HASH_TYPE, DIGEST_TYPE, MAX_LENGTH }) {
  // very important to sort buffer list before creating hash!!
  const aSortedBufferList = (aBufferList || []).sort()

  // create and return hash
  return aSortedBufferList.length > 0
    ? loaderUtils
        .getHashDigest(
          Buffer.concat(aSortedBufferList),
          HASH_TYPE,
          DIGEST_TYPE,
          MAX_LENGTH
        )
        // Windows machines are case insensitive while Linux machines are, so we only will use lower case paths
        .toLowerCase()
    : null
}
function _createHash ( aBufferList , { HASH_TYPE , DIGEST_TYPE , MAX_LENGTH } ) { // very important to sort buffer list before creating hash!! const aSortedBufferList = ( aBufferList || [ ] ) . sort ( ) // create and return hash return aSortedBufferList . length > 0 ? loaderUtils . getHashDigest ( Buffer . concat ( aSortedBufferList ) , HASH_TYPE , DIGEST_TYPE , MAX_LENGTH ) // Windows machines are case insensitive while Linux machines are, so we only will use lower case paths . toLowerCase ( ) : null }
Generate hash by binary content.
@param {Array.Buffer} [aBufferList] Buffer list with binary content.
@param {Object} [oOptions] Cach buster options.
@param {Object} [oOptions.hash] Hash generation options.
@param {string} [oOptions.HASH_TYPE] Hash type.
@param {string} [oOptions.DIGEST_TYPE] Digest type.
@param {number} [oOptions.MAX_LENGTH] Maximum hash length.
@returns {string|null} Generated hash.
Generate hash by binary content .