function encryption_get_hash_protocol

6.x encryption.module encryption_get_hash_protocol()

This looks at the hash_algos() return to see if we can use SHA256, else return FALSE.

You can override which hash is used by adding $GLOBALS["encryption_hash"] = "PROTOCOL HERE"; to the settings.php file.

1 call to encryption_get_hash_protocol()

File

modules/encryption/encryption.module, line 263
This is the main module file for the encryption module.

Code

function encryption_get_hash_protocol() {
  if (isset($GLOBALS ["encryption_hash"])) {
    return $GLOBALS ["encryption_hash"];
  }


  $arr = openssl_get_md_methods();

  if (in_array("sha256", $arr)) {
    return "sha256";
  }

  return FALSE;

}