protected function splitHash($hash) {
        $parts = @unserialize($hash);

        if (!is_array($parts)) {
            $result = ['', '', ''];
        } else {
            $parts = array_merge(['hash' => '', 'hashFunc' => '', 'salt' => ''], $parts);

            if (!$parts['hashFunc']) {
                switch (strlen($parts['hash'])) {
                    case 32:
                        $parts['hashFunc'] = 'md5';
                        break;
                    case 40:
                        $parts['hashFunc'] = 'sha1';
                        break;
                }
            }

            $result = [$parts['hash'], $parts['hashFunc'], $parts['salt']];
        }
        return $result;
    }
protected function splitHash($hash) {
        $parts = @unserialize($hash);

        if (!is_array($parts)) {
            $result = ['', '', ''];
        } else {
            $parts = array_merge(['hash' => '', 'hashFunc' => '', 'salt' => ''], $parts);

            if (!$parts['hashFunc']) {
                switch (strlen($parts['hash'])) {
                    case 32:
                        $parts['hashFunc'] = 'md5';
                        break;
                    case 40:
                        $parts['hashFunc'] = 'sha1';
                        break;
                }
            }

            $result = [$parts['hash'], $parts['hashFunc'], $parts['salt']];
        }
        return $result;
    }
protected function splitHash ( $ hash ) { $ parts = @ unserialize ( $ hash ) ; if ( ! is_array ( $ parts ) ) { $ result = [ '' , '' , '' ] ; } else { $ parts = array_merge ( [ 'hash' => '' , 'hashFunc' => '' , 'salt' => '' ] , $ parts ) ; if ( ! $ parts [ 'hashFunc' ] ) { switch ( strlen ( $ parts [ 'hash' ] ) ) { case 32 : $ parts [ 'hashFunc' ] = 'md5' ; break ; case 40 : $ parts [ 'hashFunc' ] = 'sha1' ; break ; } } $ result = [ $ parts [ 'hash' ] , $ parts [ 'hashFunc' ] , $ parts [ 'salt' ] ] ; } return $ result ; }
Split the hash into its calculated hash and salt.

@param string $hash The hash to split.
@return array An array in the form [$hash, $hashFunc, $salt].
Split the hash into its calculated hash and salt .