So essentially the question is, can I use a SHA1 hash to send a verification email to a new user with little chance of duplicate hash?
I want to send a user this email: www.example.com/verify.php?hash=[40 digit sha1 hash]
as opposed to sending them this emai: www.example.com/verify.php?user=123456&hash=[40 digit sha1 hash]
I want to avoid sending a second user parameter.
The hash is created as such:
$verifyHash = sha1[$uid.$email.date('r')];
Where $uid
is unique, $email
is unique and date('r')
is as unique as possible with unix timestamp.
What do you think the chances are of duplicate hashes being created?