fetch-filecache.js
function filenamify(url) {
  let res = filenamifyUrl(url);
  if (res.length >= 60) {
    res = res.substr(0, 60) +
      '-md5-' +
      crypto.createHash('md5').update(url, 'utf8').digest('hex');
  }
  return res;
}
function filenamify(url) {
  let res = filenamifyUrl(url);
  if (res.length >= 60) {
    res = res.substr(0, 60) +
      '-md5-' +
      crypto.createHash('md5').update(url, 'utf8').digest('hex');
  }
  return res;
}
function filenamify ( url ) { let res = filenamifyUrl ( url ) ; if ( res . length >= 60 ) { res = res . substr ( 0 , 60 ) + '-md5-' + crypto . createHash ( 'md5' ) . update ( url , 'utf8' ) . digest ( 'hex' ) ; } return res ; }
Wrapper around the filenamify library to handle lengthy URLs.

By default filenamify truncates the result to 100 characters, but that may
not be enough to distinguish between cache entries. When string is too long,
replace the end by an MD5 checksum.

Note we keep the beginning from filenamify because it remains somewhat human
friendly.

@function
@param {String} url The URL to convert to a filename
@return {String} A safe filename that is less than 100 characters long
Wrapper around the filenamify library to handle lengthy URLs .