@deprecated
@param string $hash
@param string|null $context

@return string
11641
public function getFile(string $hash, ?string $context = null): string
    {
        @trigger_error("StorageManager::getFile is deprecated use the getContents or the getResource function", E_USER_DEPRECATED);
        $resource = $this->read($this->adapters, $hash, $context);
        //TODO:use (if neede) http://php.net/manual/en/class.spltempfileobject.php
        $filename = tempnam(sys_get_temp_dir(), 'EMS');
        file_put_contents($filename, $resource);
        return $filename;
    }
1037905
public function needsPasswordRehash($hash) {
		$PasswordHasher = $this->_getPasswordHasher($this->_config['passwordHasher']);
		if (!method_exists($PasswordHasher, 'needsRehash')) {
			return false;
		}
		return $PasswordHasher->needsRehash($hash);
	}
507225
function setHash($hash)
    {
        $hash = strtolower($hash);
        switch ($hash) {
            case 'md5-96':
            case 'sha1-96':
                $this->l = 12; // 96 / 8 = 12
                break;
            case 'md2':
            case 'md5':
                $this->l = 16;
                break;
            case 'sha1':
                $this->l = 20;
                break;
            case 'sha256':
                $this->l = 32;
                break;
            case 'sha384':
                $this->l = 48;
                break;
            case 'sha512':
                $this->l = 64;
        }

        switch ($hash) {
            case 'md2':
                $mode = CRYPT_HASH_MODE == CRYPT_HASH_MODE_HASH && in_array('md2', hash_algos()) ?
                    CRYPT_HASH_MODE_HASH : CRYPT_HASH_MODE_INTERNAL;
                break;
            case 'sha384':
            case 'sha512':
                $mode = CRYPT_HASH_MODE == CRYPT_HASH_MODE_MHASH ? CRYPT_HASH_MODE_INTERNAL : CRYPT_HASH_MODE;
                break;
            default:
                $mode = CRYPT_HASH_MODE;
        }

        switch ( $mode ) {
            case CRYPT_HASH_MODE_MHASH:
                switch ($hash) {
                    case 'md5':
                    case 'md5-96':
                        $this->hash = MHASH_MD5;
                        break;
                    case 'sha256':
                        $this->hash = MHASH_SHA256;
                        break;
                    case 'sha1':
                    case 'sha1-96':
                    default:
                        $this->hash = MHASH_SHA1;
                }
                return;
            case CRYPT_HASH_MODE_HASH:
                switch ($hash) {
                    case 'md5':
                    case 'md5-96':
                        $this->hash = 'md5';
                        return;
                    case 'md2':
                    case 'sha256':
                    case 'sha384':
                    case 'sha512':
                        $this->hash = $hash;
                        return;
                    case 'sha1':
                    case 'sha1-96':
                    default:
                        $this->hash = 'sha1';
                }
                return;
        }

        switch ($hash) {
            case 'md2':
                 $this->b = 16;
                 $this->hash = array($this, '_md2');
                 break;
            case 'md5':
            case 'md5-96':
                 $this->b = 64;
                 $this->hash = array($this, '_md5');
                 break;
            case 'sha256':
                 $this->b = 64;
                 $this->hash = array($this, '_sha256');
                 break;
            case 'sha384':
            case 'sha512':
                 $this->b = 128;
                 $this->hash = array($this, '_sha512');
                 break;
            case 'sha1':
            case 'sha1-96':
            default:
                 $this->b = 64;
                 $this->hash = array($this, '_sha1');
        }

        $this->ipad = str_repeat(chr(0x36), $this->b);
        $this->opad = str_repeat(chr(0x5C), $this->b);
    }
520517
public function get_hash($key = 0)
	{
		$hashes = $this->get_hashes();
		if (isset($hashes[$key]))
		{
			return $hashes[$key];
		}

		return null;
	}
1149487
protected function convertZoneFromHash($hash)
    {
        if (isset($hash['blocks'])) {
            $blocks = array();

            foreach ($hash['blocks'] as $block) {
                $blocks[] = $this->convertBlockFromHash($block);
            }

            $hash['blocks'] = $blocks;
        }

        return new Zone($hash);
    }
42952
public static function decode($hash)
    {
        $minlng = -180;
        $maxlng = 180;
        $minlat = -90;
        $maxlat = 90;

        for ($i=0,$c=strlen($hash); $i<$c; $i++) {
            $v = strpos(self::$table, $hash[$i]);
            if (1&$i) {
                if (16&$v) {
                    $minlat = ($minlat + $maxlat) / 2;
                } else {
                    $maxlat = ($minlat + $maxlat) / 2;
                }
                if (8&$v) {
                    $minlng = ($minlng + $maxlng) / 2;
                } else {
                    $maxlng = ($minlng + $maxlng) / 2;
                }
                if (4&$v) {
                    $minlat = ($minlat + $maxlat) / 2;
                } else {
                    $maxlat = ($minlat + $maxlat) / 2;
                }
                if (2&$v) {
                    $minlng = ($minlng + $maxlng) / 2;
                } else {
                    $maxlng = ($minlng + $maxlng) / 2;
                }
                if (1&$v) {
                    $minlat = ($minlat + $maxlat) / 2;
                } else {
                    $maxlat = ($minlat + $maxlat) / 2;
                }
            } else {
                if (16&$v) {
                    $minlng = ($minlng + $maxlng) / 2;
                } else {
                    $maxlng = ($minlng + $maxlng) / 2;
                }
                if (8&$v) {
                    $minlat = ($minlat + $maxlat) / 2;
                } else {
                    $maxlat = ($minlat + $maxlat) / 2;
                }
                if (4&$v) {
                    $minlng = ($minlng + $maxlng) / 2;
                } else {
                    $maxlng = ($minlng + $maxlng) / 2;
                }
                if (2&$v) {
                    $minlat = ($minlat + $maxlat) / 2;
                } else {
                    $maxlat = ($minlat + $maxlat) / 2;
                }
                if (1&$v) {
                    $minlng = ($minlng + $maxlng) / 2;
                } else {
                    $maxlng = ($minlng + $maxlng) / 2;
                }
            }
        }

        return array($minlng, $maxlng, $minlat, $maxlat);
    }
342564
public function setHash($hash)
    {
        $cache = Config::getParam('cache.var', '');
        $this->hash = $hash . (strlen($cache) ? '.' : '') . $cache;
        return $this;
    }
526938
public function get(string $key, string $hash = '')
    {
        if (!$key && $hash) {
            $wp_using_ext_object_cache            = wp_using_ext_object_cache(false);
            $key                                  = $this->hashToKey($hash);
            $do_restore_wp_using_ext_object_cache = true; // See below.
        }
        if ($this->App->Config->§specs['§is_network_wide'] && $this->Wp->is_multisite) {
            $value = get_site_transient($this->App->Config->©brand['©var'].'_'.$key);
        } else {
            $value = get_transient($this->App->Config->©brand['©var'].'_'.$key);
        }
        if (!empty($do_restore_wp_using_ext_object_cache)) {
            wp_using_ext_object_cache($wp_using_ext_object_cache);
        }
        return $value === false ? null : $value;
    }
272473
public function oathTruncate($hash)
    {
        $offset = ord($hash[19]) & 0xf;

        $temp = unpack('N', substr($hash, $offset, 4));

        return substr(
            $temp[1] & 0x7fffffff,
            -$this->getOneTimePasswordLength()
        );
    }
1334000
public function delete($table, $hash, $range = null, Context\Delete $context = null)
    {
        if (null !== $this->logger) {
            $this->log('Delete on table '.$table);
        }

        // Primary key
        $hash = new Attribute($hash);
        $key = array(
            'HashKeyElement' => $hash->getForDynamoDB()
        );

        // Range key
        if (null !== $range) {
            $range = new Attribute($range);
            $key['RangeKeyElement'] = $range->getForDynamoDB();
        }

        $parameters = array(
            'TableName' => $table,
            'Key'       => $key
        );

        if (null !== $context) {
            $parameters += $context->getForDynamoDB();
        }

        if (null !== $this->logger) {
            $this->log('Delete request paramaters : '.print_r($parameters, true), Logger::DEBUG);
        }

        $response = $this->connector->deleteItem($parameters);

        if (null !== $this->logger) {
            $this->log('Delete request response : '.print_r($response, true), Logger::DEBUG);
        }

        // Update write counter
        $this->addConsumedWriteUnits($table, floatval($response['ConsumedCapacityUnits']));

        return $this->populateAttributes($response);
    }
1014890
public function createCacheFile(string $hash, string $fileName, ?string $context = null): bool
    {
        foreach ($this->cacheAdapters as $cacheAdapter) {
            if ($cacheAdapter->create($hash, $fileName, $context)) {
                return true;
            }
        }

        return false;
    }
314957
public function cancel($hash = null)
    {
        if (! isset($hash)) {
            return redirect()->route('admin.posts.index');
        }

        $userHash = $this->auth_user->hash;
        if ($this->cache->has("autoSavedPost-$userHash")) {
            $this->cache->forget("autoSavedPost-$userHash");
        }

        $post = $this->post->byHash($hash);
        $post->being_edited_by = null;
        $post->save();

        $this->tracert->log('posts', $post->id, $this->auth_user->id, 'canceled');

        $message = trans('blogify::notify.success', [
            'model' => 'Post', 'name' => $post->name, 'action' =>'canceled'
        ]);
        session()->flash('notify', ['success', $message]);

        return redirect()->route('admin.posts.index');
    }
532743
public function setHash(string $hash): self
    {
        $this->hash = (string) hex2bin($hash);
        return $this;
    }
1356199
public function urlHash($hash = null, $withHash = true)
    {
        if ($hash) {
            $this->set('urlHash', ltrim($hash, '#'));
        }

        $hash = $this->get('urlHash', '');

        return $withHash && !empty($hash) ? '#' . $hash : $hash;
    }
742355
public function expireUserToken($hash)
    {
        try {
            return $this->innerGateway->expireUserToken($hash);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
444698
public function finalizeUpload(string $hash, ?string $context = null): bool
    {
        $out = parent::finalizeUpload($hash, $context);
        $path = $this->getPath($hash, $context, false);
        $this->s3Client->deleteObject([
            'Bucket'     => $this->bucket,
            'Key'        => substr($path, 1+strlen($this->getBaseUrl()))
        ]);
        return $out;
    }
295618
public function setExtra($hash)
    {
        $rev = strpos($hash, '_rev');
        $this->rev = false;
        if ($rev !== false) {
            $hash = substr($hash, 0, $rev);
            $this->rev = true;
        }
        $this->hash_name = $hash;
    }