PDA

Click to See Complete Forum and Search --> : [RESOLVED] implementing SHA256, 512?


solitario
Jan 23rd, 2008, 03:48 PM
Hello all.
When I write the following:echo sha1($variable_to_encode);everything works fine.

But the same is not true when I replace "sha1" with "sha256" or "sha512".

I did a:var_dump(hash_algos()); and I do have both listed on my system. Plus when I go to php.net/sha256, I don't get documentation the way you would with any other function.
If anyone could help me realize what I'm doing wrong I'd appreciate it.
Thanks.

the182guy
Jan 23rd, 2008, 04:07 PM
Use the hash() function. It supports a number of different message digest systems, just change the first parameter.

echo hash("sha512","string to encrypt");


http://www.php.net/manual/en/function.hash.php

solitario
Jan 24th, 2008, 08:33 AM
simple enough. thanks!