Return to Snippet

Revision: 12161
at March 4, 2009 11:25 by lajevardi


Updated Code
function generateHash(){
	$result = "";
	$charPool = '0123456789abcdefghijklmnopqrstuvwxyz';
	for($p = 0; $p<15; $p++)
		$result .= $charPool[mt_rand(0,strlen($charPool)-1)];
	return sha1(md5(sha1($result)));
}

Revision: 12160
at March 4, 2009 11:18 by lajevardi


Updated Code
function generateHash(){
	$result = "";
	$charPool = '0123456789abcdefghijklmnopqrstuvwxyz';
	for($p = 0; $p<15; $p++)
		$result .= $charPool[mt_rand(0,strlen($charPool)-1)];
	return md5(sha1(md5($result)));
}

Revision: 12159
at March 4, 2009 11:15 by lajevardi


Initial Code
function generateHash(){
	$result = "";
	$charPool = '0123456789abcdefghijklmnopqrstuvwxyz';
	for($p = 0; $p<15; $p++)
		$result .= $charPool[mt_rand(0,strlen($charPool)-1)];
		return md5(sha1(md5($result)));
		}

Initial URL

                                

Initial Description
I'm using this to send verification emails.

Initial Title
Generating random hash

Initial Tags

                                

Initial Language
PHP