Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SHA-256 for CodeIgniter hashing

CodeIgniter uses MD5 or SHA1 for its hashing:

$str = do_hash($str); // SHA1

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

But, my project requires SHA-256. How would I resolve this?

like image 470
Kriem Avatar asked Feb 12 '26 11:02

Kriem


1 Answers

Can you not just call php's own hash()?

$str = hash ( "sha256", $str );
like image 94
Brian Avatar answered Feb 15 '26 01:02

Brian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!