do_hash()

do_hash($str[, $type = 'sha1'])

Parameters:
  • $str (string) – Input
  • $type (string) – Algorithm
Returns:

Hex-formatted hash

Return type:

string

Permits you to create one way hashes suitable for encrypting passwords. Will use SHA1 by default.

See hash_algos() for a full list of supported algorithms.

Examples:

$str = do_hash($str); // SHA1
$str = do_hash($str, 'md5'); // MD5

Note

This function was formerly named dohash(), which has been removed in favor of do_hash().

Note

This function is DEPRECATED. Use the native hash() instead.

doc_CodeIgniter
2016-10-15 16:32:15
Comments
Leave a Comment

Please login to continue.