Pobiera hash dla danej nazwy pliku
@param string $name nazwa pliku
@return string
324163
public function getHashName()
    {
        //brak pliku
        if ($this->id === null) {
            return;
        }
        return substr(md5($this->name . \App\Registry::$config->salt), 0, 8);
    }
1010167
public function rename($hash, $name) {
		if ($this->commandDisabled('rename')) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}
		
		if (!$this->nameAccepted($name)) {
			return $this->setError(elFinder::ERROR_INVALID_NAME, $name);
		}
		
		if (!($file = $this->file($hash))) {
			return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		if ($name == $file['name']) {
			return $file;
		}
		
		if (!empty($file['locked'])) {
			return $this->setError(elFinder::ERROR_LOCKED, $file['name']);
		}
		
		$path = $this->decode($hash);
		$dir  = $this->_dirname($path);
		$stat = $this->stat($this->_joinPath($dir, $name));
		if ($stat) {
			return $this->setError(elFinder::ERROR_EXISTS, $name);
		}
		
		if (!$this->_move($path, $dir, $name)) {
			return false;
		}
		
		if (!empty($stat['tmb']) && $stat['tmb'] != "1") {
			$this->rmTmb($stat['tmb']);
		}
		
		$path = $this->_joinPath($dir, $name);

		$this->clearcache();
		return $this->stat($path);
	}
634786
protected function getUriFromKey($name)
    {
        if(preg_match('/(?=[A-Z])/',$name) !== false)
        {
            $pieces = preg_split('/(?=[A-Z])/',$name);
            $uri = strtolower(join('_', $pieces));
        }
        else $uri = $name;

        return $uri;
    }
457625
public static function hash(string $name, ?array $fields = null, int $expire = 0): RedisHash
    {
        //创建Hash对象
        $hash = new RedisHash(self::handle(), $name);

        //如果指定了值,则设置值
        if (!is_null($fields)) {
            $hash->inserts($fields);
        }

        //设置过期时间(秒)
        $hash->setExpire($expire);

        //返回 Hash对象
        return $hash;
    }
203492
protected function replaceDollar($name)
    {
        if (preg_match('/\$/', $name)) {
            $name = preg_replace_callback('/\$([a-z])/', function ($matches) {
                return 'dollar' . ucfirst($matches[1]);
            }, $name);
        }

        return $name;
    }
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);
    }
655246
protected function _unlink($path, $name)
    {
        //pętla po wszystkich plikach
        foreach (glob($path . '/*') as $file) {
            if (is_dir($file)) {
                //rekurencyjnie schodzi katalog niżej
                $this->_unlink($file, $name);
                continue;
            }
            //kasowanie pliku jeśli nazwa jest zgodna z wzorcem
            if (basename($file) == $name) {
                unlink($file);
            }
        }
    }
329123
public static function string($name)
    {
        $buffer = [];
        foreach (self::trigger($name) as $hook) {
            $buffer[] = $hook->output;
        }
        
        return implode("", $buffer);
    }
116836
public function getInstanceHash()
    {
        //zwraca md5 ze zrzutu MmiChangelog (część cms) wraz z saltem
        return md5(print_r((new \Mmi\Orm\ChangelogQuery)
                    ->whereFilename()->like('%_cms_%')
                    ->orderAscFilename()
                    ->findPairs('filename', 'md5'), true) . \App\Registry::$config->salt);
    }
1079459
public function hasHeader($name)
        {
            $name = $this->setHeaderName($name);
            return array_key_exists($name, $this->headers);
        }
714856
protected function getMigrationFullName($name)
    {
        $folder = '';

        if (Config::organizeMigrations()) {
            $folder = $this->getTableName();
        }

        return $this->getMigrationPath($folder) . DIRECTORY_SEPARATOR . $name . '.php';
    }
941620
public function getSecret($name)
    {
        $value = $this->get($name);
        if (empty($value)) {
            return false;
        } else {
            return \ePHP\Hash\Encrypt::decryptG($value, md5($_SERVER['HTTP_HOST'].APP_PATH.SERVER_MODE));
        }
    }
221035
public function getFilter($name)
    {
        //wyszukiwanie filtra w strukturze
        foreach (\Mmi\App\FrontController::getInstance()->getStructure('filter') as $namespace => $filters) {
            if (!isset($filters[$name])) {
                continue;
            }
            //filtr znaleziony
            $className = '\\' . $namespace . '\\Filter\\' . ucfirst($name);
        }
        //brak filtra
        if (!isset($className)) {
            throw new \Mmi\Mvc\MvcException('Filter not found: ' . $name);
        }
        //zwrot zarejestrowanego filtra, lub tworzenie nowego + rejestracja
        return isset($this->_filters[$className]) ? $this->_filters[$className] : ($this->_filters[$className] = new $className);
    }
331321
public static function newName($name)
    {
        if (file_exists($name)) {
            $extension = self::getFileExtension($name);
            $name = substr($name,0,(-strlen($extension)-1)) . '_' . sha1(uniqid(rand(), true)) . ".$extension";
        }
        return $name;
    }
749733
protected static function getNormalizedHeaderKey(string $name){
        static $convertCache = [];

        if(!isset($convertCache[$name])){
            $convertCache[$name]    = ucfirst(ucwords($name, "-"));
        }

        return $convertCache[$name];
    }
1026550
public function downloadTheme($name, $hash)
    {
        $fileCode = $name . $hash;

        $this->requestServerFile('theme/get', $fileCode, $hash, ['name' => $name]);
    }
672113
public function id($name)
    {
        $keepIdx = preg_replace('/\[(\d+)\]/', "_$1", $name);
        $unbracketted = $this->removeBrackets($keepIdx, '_');
        $nothingWeird = preg_replace('/[^\w\d\_]+?/', "", $unbracketted);
        $noTrail = preg_replace('/_$/', "", $nothingWeird);

        $clean = $noTrail;

        if (!is_null($this->associatedEntity) && $this->associatedEntity->isSupportedAttribute($name)) {
            $clean = $this->associatedEntity->getInputName() . "_" . $clean;
        }

        return $this->keys['POST_WRAP'] . "_" . $clean;
    }