php - Using SHA-256 for CodeIgniter hashing

557

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?

748

Answer

Solution:

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

$str = hash ( "sha256", $str );

People are also looking for solutions to the problem: MVC PHP - Sending mail from Model

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.