Bundle/CoreBundle/Twig/Extension/CmsExtension.php
public function hash($value, $algorithm = 'md5')
    {
        try {
            return hash($algorithm, $value);
        } catch (\Exception $e) {
            error_log('Please check that the '.$algorithm.' does exists because it failed when trying to run. We are expecting a valid algorithm such as md5 or sha512 etc. ['.$e->getMessage().']');

            return $value;
        }
    }
public function hash($value, $algorithm = 'md5')
    {
        try {
            return hash($algorithm, $value);
        } catch (\Exception $e) {
            error_log('Please check that the '.$algorithm.' does exists because it failed when trying to run. We are expecting a valid algorithm such as md5 or sha512 etc. ['.$e->getMessage().']');

            return $value;
        }
    }
public function hash ( $ value , $ algorithm = 'md5' ) { try { return hash ( $ algorithm , $ value ) ; } catch ( \ Exception $ e ) { error_log ( 'Please check that the ' . $ algorithm . ' does exists because it failed when trying to run. We are expecting a valid algorithm such as md5 or sha512 etc. [' . $ e -> getMessage ( ) . ']' ) ; return $ value ; } }
hash some string with given algorithm.

@param string $value     The string to hash
@param string $algorithm The algorithm we have to use to hash the string

@return string
hash some string with given algorithm .