marquis Posted January 20, 2007 Share Posted January 20, 2007 how do u use sha512 i can get sha1 to work but not 512 Link to comment Share on other sites More sharing options...
MrAdam Posted January 20, 2007 Share Posted January 20, 2007 well i think you'd need to use it with the "mhash()" function, an example of it using md5:mhash(MHASH_MD5, $str);i'm not sure if "sha512" is valid or not.. the mhash function doesn't come as a standard with PHP i believe, you have download it. Link to comment Share on other sites More sharing options...
Escee Posted January 20, 2007 Share Posted January 20, 2007 Sha512 isn't supported by PHP (yet).. just use Md5 (only the easy way comparing with MrAdam's code ): md5 ( 'mypassword/string' ); Link to comment Share on other sites More sharing options...
justsomeguy Posted January 22, 2007 Share Posted January 22, 2007 SHA-512 might be supported, depending on your version of PHP. PHP 5.2.0, for example, does support SHA-512. Use this code to determine which hashing algorithms your system supports: <?phpprint_r(hash_algos());?> On the server that I am on, I see this result: Array( [0] => md4 [1] => md5 [2] => sha1 [3] => sha256 [4] => sha384 [5] => sha512 [6] => ripemd128 [7] => ripemd160 [8] => whirlpool [9] => tiger128,3 [10] => tiger160,3 [11] => tiger192,3 [12] => tiger128,4 [13] => tiger160,4 [14] => tiger192,4 [15] => snefru [16] => gost [17] => adler32 [18] => crc32 [19] => crc32b [20] => haval128,3 [21] => haval160,3 [22] => haval192,3 [23] => haval224,3 [24] => haval256,3 [25] => haval128,4 [26] => haval160,4 [27] => haval192,4 [28] => haval224,4 [29] => haval256,4 [30] => haval128,5 [31] => haval160,5 [32] => haval192,5 [33] => haval224,5 [34] => haval256,5) That means that I can use any of those algorithms with the hash function: hash("sha512", $str);hash("whirlpool", $str);hash("haval256,4", $str); etc Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now