You are here

function shrinktheweb_generateHash in ShrinkTheWeb 8

Same name and namespace in other branches
  1. 6 shrinktheweb.api.inc \shrinktheweb_generateHash()
  2. 7 shrinktheweb.api.inc \shrinktheweb_generateHash()

Generate the hash for the thumbnail, this is used as filename also.

Parameters

$aArgs:

Return value

string

4 calls to shrinktheweb_generateHash()
ShrinkTheWebCallbackController::receiveScreenshot in src/Controller/ShrinkTheWebCallbackController.php
shrinktheweb_checkWebsiteThumbnailCaptured in ./shrinktheweb.api.inc
Method that checks if the thumbnail for the specified website exists.
shrinktheweb_deleteThumbnail in ./shrinktheweb.api.inc
Delete thumbnail.
shrinktheweb_getCachedThumbnail in ./shrinktheweb.api.inc
Get a thumbnail, caching it first if possible.

File

./shrinktheweb.api.inc, line 656

Code

function shrinktheweb_generateHash($aArgs) {
  $sPrehash = $aArgs['stwfull'] ? 'a' : 'c';
  $sPrehash .= $aArgs['stwxmax'] . 'x' . $aArgs['stwymax'];
  if ($aArgs['stwnrx']) {
    $sPrehash .= 'b' . $aArgs['stwnrx'] . 'x' . $aArgs['stwnry'];
  }

  // For backward compatibility with existing filenames.
  $sUrl = urldecode($aArgs['stwurl']);
  return md5($sPrehash . $aArgs['stwq'] . $sUrl);
}