function shrinktheweb_generateHash in ShrinkTheWeb 7
Same name and namespace in other branches
- 8 shrinktheweb.api.inc \shrinktheweb_generateHash()
- 6 shrinktheweb.api.inc \shrinktheweb_generateHash()
Generate the hash for the thumbnail, this is used as filename also
3 calls to shrinktheweb_generateHash()
- 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 471
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'];
}
$sPrehash .= $aArgs['stwinside'];
$aReplace = array(
'http',
'https',
'ftp',
'://',
);
$sUrl = str_replace($aReplace, '', $aArgs['stwurl']);
return md5($sPrehash . $aArgs['stwsize'] . $aArgs['stwq'] . $sUrl);
}