which is the best to use 'md5' or 'sha1'?

Possible to give a small example also?

Thanks Regards, X

PS: Problem im having is getting the 'md5/sha1' function to work so I can upload the output into to my database

Recommended Answers

All 2 Replies

MD5.


Here is a sample for both:

<?php
$salt1="something custom";
$salt2="blahblah";
$salt3="differentblah";
$hash1=sha1($salt1.$source)
$hash2=sha1($salt2.$source);
$hash3=md5($salt3.$source);
?>

difference between hash 1 and 2 (minus the semi colon)?

and what is the value of this $source?

I gather the output would be some hexadecimal value correct?

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.