function _make_hash

8.0.x make.download.inc _make_hash($algo, $string)
6.x make.download.inc _make_hash($algo, $string)
7.x make.download.inc _make_hash($algo, $string)
5.x make.download.inc _make_hash($algo, $string)
master make.download.inc _make_hash($algo, $string)

Calculate the hash of a string for a given algorithm.

1 call to _make_hash()
_make_verify_checksums in commands/make/make.download.inc
Test that any supplied hash values match the hash of the file content.

File

commands/make/make.download.inc, line 539
Download-specific functions for Drush Make.

Code

function _make_hash($algo, $string) {
  switch ($algo) {
    case 'md5':
      return md5($string);
    case 'sha1':
      return sha1($string);
    default:
      return function_exists('hash') ? hash($algo, $string) : '';
  }
}