Converts the given $hash to a Block node.

@param mixed $hash

@return \eZ\Publish\Core\FieldType\Page\Parts\Block
543546
protected function convertBlockFromHash($hash)
    {
        if (isset($hash['items'])) {
            $items = array();

            foreach ($hash['items'] as $item) {
                $items[] = $this->convertItemFromHash($item);
            }

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

        return new Block($hash);
    }
1254666
public static function isBlowfishHash( $hash ) {
		$peek = strlen( self::BLOWFISH_PREFIX );
		return strlen( $hash ) == 60 &&
			substr( $hash, 0, $peek ) == self::BLOWFISH_PREFIX;
	}
1052262
public function forceExpiry($hash)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('Cacheable::forceExpiry()', 'Cacheable::delete()');
        }
        return $this->delete($hash);
    }
872741
public static function Serialize($hash){
		if(is_null($hash))
			return null;
		$res=Array();
		$keys=array_keys($hash);
		$i=-1;
		$len=sizeof($keys);
		while(++$i<$len)
			$res[]=new PhpWsdlHash($keys[$i],$hash[$keys[$i]]);
		return $res;
	}
1239067
protected function convertItemFromHash($hash)
    {
        foreach ($hash as $key => &$item) {
            switch ($key) {
                case 'publicationDate':
                case 'visibilityDate':
                case 'hiddenDate':
                case 'rotationUntilDate':
                    // $item is expected to be a date string in RFC850 format
                    $item = new \DateTime($item);
                    break;
            }
        }

        return new Item($hash);
    }
469785
private function splitHash($hash) {
        if (strpos($hash, '$') === false) {
            return [$hash, false];
        } else {
            $parts = explode('$', $hash, 2);
            return $parts;
        }
    }
645789
public function fromHash($hash)
    {
        if ($hash === null) {
            return $this->getEmptyValue();
        }

        $countries = array();
        foreach ($hash as $country) {
            foreach ($this->countriesInfo as $countryInfo) {
                switch ($country) {
                    case $countryInfo['Name']:
                    case $countryInfo['Alpha2']:
                    case $countryInfo['Alpha3']:
                        $countries[$countryInfo['Alpha2']] = $countryInfo;
                        continue 3;
                }
            }

            throw new InvalidValue($country);
        }

        return new Value($countries);
    }
386112
protected function loadPyStringHash(array $hash, $line = 0)
    {
        $line = isset($hash['line']) ? $hash['line'] : $line;

        $strings = array();
        foreach (explode("\n", $hash['text']) as $string) {
            $strings[] = $string;
        }

        return new PyStringNode($strings, $line);
    }
943805
public function byHash($hash)
    {
        $params = ["hash" => $hash];
        $apiUrl = $this->getPath('get', $params);
        $response = $this->api->getJSON($apiUrl);

        //XXX include Error checks
        $object = json_decode($response, true);
        return $this->createTransactionModel($object['data']); //XXX brr => error/content validation first
    }
1082953
public function newPasswordAction($hash)
    {
        $user = $this->userManager->getByResetPasswordHash($hash);
        $form = $this->formFactory->create(FormFactory::TYPE_USER_RESET_PWD, array(), $user);
        $form->handleRequest($this->request);

        if ($form->isValid()) {
            $data = $form->getData();
            $plainPassword = $data->getPlainPassword();
            $user->setPlainPassword($plainPassword);
            $this->userManager->activateUser($user);
            $this->om->persist($user);
            $this->om->flush();
            $this->request->getSession()
                ->getFlashBag()
                ->add('warning', $this->translator->trans('password_ok', array(), 'platform'));

            return new RedirectResponse($this->router->generate('claro_security_login'));
        }

        return array(
            'hash' => $hash,
            'form' => $form->createView()
        );
    }
1175696
function setHash($a1hash)
    {
        $a1hash = (string) $a1hash;
        if (strlen($a1hash) !== 32)
            // MD5 hash error
            throw new \InvalidArgumentException(sprintf('The A1 Hash (%s) seems is invalid.', $a1hash));
        
        $this->hash = $a1hash;
        return $this;
    }
404038
private function buildKeysCachingPath($hash)
    {
        $chunks = self::chunkSplitArr($hash, 2, '0');
        $chunksCount = count($chunks);
        if ($this->levels > $chunksCount) {
            $diff = $this->levels - $chunksCount;
            $tempArray = array_fill(0, $diff, '00');
            $chunks = array_merge($chunks, $tempArray);
        }

        return vsprintf($this->levelsString, $chunks);
    }
882683
protected function loadContent(string $hash): ?string
    {
        if (!array_key_exists($hash, $this->cache)) {
            $content = $this->adapter->load($this->namespace, $hash);
            $this->cache[$hash] = is_string($content) ? $content : null;
        }
        return $this->cache[$hash];
    }
737579
public function setHashAlgorithm($hash)
    {
        switch ($hash) {
            case 'rsa-sha1':
                $this->hashAlgorithm = 'rsa-sha1';
                break;
            case 'rsa-sha256':
                $this->hashAlgorithm = 'rsa-sha256';
                if (!defined('OPENSSL_ALGO_SHA256')) {
                    throw new Swift_SwiftException('Unable to set sha256 as it is not supported by OpenSSL.');
                }
                break;
            default:
                throw new Swift_SwiftException('Unable to set the hash algorithm, must be one of rsa-sha1 or rsa-sha256 (%s given).', $hash);
        }

        return $this;
    }
1280176
public function getBlockHash($index)
    {
        $args = [
            (int)$index
        ];
        return $this->rpc->query(__FUNCTION__, $args);
    }
1089941
public BlockLocator add(Sha256Hash hash) {
        return new BlockLocator(new ImmutableList.Builder<Sha256Hash>().addAll(this.hashes).add(hash).build());
    }
483573
public function request($hash)
    {
        $adapter = new CancelAdapter($hash, $this->config);
        $response = $this->client->cancel($adapter->transform());

        return $response;
    }