classes/phing/tasks/ext/ManifestTask.php
private function hash($msg, $algo)
    {
        if (extension_loaded('hash')) {
            $algo = strtolower($algo);

            if (in_array($algo, hash_algos())) {
                return hash($algo, $this->salt . $msg);
            }
        }

        if (extension_loaded('mhash')) {
            $algo = strtoupper($algo);

            if (defined('MHASH_' . $algo)) {
                return mhash('MHASH_' . $algo, $this->salt . $msg);
            }
        }

        switch (strtolower($algo)) {
            case 'md5':
                return md5($this->salt . $msg);
            case 'crc32':
                return abs(crc32($this->salt . $msg));
        }

        return false;
    }
private function hash($msg, $algo)
    {
        if (extension_loaded('hash')) {
            $algo = strtolower($algo);

            if (in_array($algo, hash_algos())) {
                return hash($algo, $this->salt . $msg);
            }
        }

        if (extension_loaded('mhash')) {
            $algo = strtoupper($algo);

            if (defined('MHASH_' . $algo)) {
                return mhash('MHASH_' . $algo, $this->salt . $msg);
            }
        }

        switch (strtolower($algo)) {
            case 'md5':
                return md5($this->salt . $msg);
            case 'crc32':
                return abs(crc32($this->salt . $msg));
        }

        return false;
    }
private function hash ( $ msg , $ algo ) { if ( extension_loaded ( 'hash' ) ) { $ algo = strtolower ( $ algo ) ; if ( in_array ( $ algo , hash_algos ( ) ) ) { return hash ( $ algo , $ this -> salt . $ msg ) ; } } if ( extension_loaded ( 'mhash' ) ) { $ algo = strtoupper ( $ algo ) ; if ( defined ( 'MHASH_' . $ algo ) ) { return mhash ( 'MHASH_' . $ algo , $ this -> salt . $ msg ) ; } } switch ( strtolower ( $ algo ) ) { case 'md5' : return md5 ( $ this -> salt . $ msg ) ; case 'crc32' : return abs ( crc32 ( $ this -> salt . $ msg ) ) ; } return false ; }
Wrapper method for hash generation
Automatically selects extension
Falls back to built-in functions

@link http://www.php.net/mhash
@link http://www.php.net/hash

@param string $msg The string that should be hashed
@param string $algo Algorithm

@return mixed  String on success, false if $algo is not available
Wrapper method for hash generation Automatically selects extension Falls back to built - in functions