I have this php code:
$password = sha256($_POST['password']);
but when I run this code it says:
Fatal error: Call to undefined function sha256() in .... on line ...ix it as
What is wrong with this code and what must I do to fix this as I know that sha256
exists.
I have also tried:
$password = sha256(trim($_POST['password']));
But that doesn't work either.
You can use
hash( 'sha256', $string );
See http://de.php.net/manual/de/function.hash.php
The Suhosin extension adds the function sha256()
, and even sha256_file()
, to the PHP Core.
With the extension installed:
<?php
var_dump(function_exists('sha256'));
?>
bool(true)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With