Welcome Guest, Not a member yet? Register   Sign In
Users and Profiles DB and Forgotten password
#6

[eluser]Dan Horrigan[/eluser]
You could use the same thing then pick 15 or 20 random characters from the string. You could do something like this:

Code:
function partial_hash($hash, $len)
{
    $hash_len = strlen($hash);
    $partial = '';
    for($i=0; $i > $hash_len; $i++)
    {
        $partial .= substr($hash, rand(1, $hash_len), 1);
    }
    return $partial;
}

Calling this function would give you a random sampling of the hash you send it. $len is how long the partial should be.

I have not tested this code.


Messages In This Thread
Users and Profiles DB and Forgotten password - by El Forum - 06-08-2009, 11:37 PM
Users and Profiles DB and Forgotten password - by El Forum - 06-09-2009, 07:05 AM
Users and Profiles DB and Forgotten password - by El Forum - 06-09-2009, 08:21 AM
Users and Profiles DB and Forgotten password - by El Forum - 06-09-2009, 08:26 AM
Users and Profiles DB and Forgotten password - by El Forum - 06-09-2009, 09:14 AM
Users and Profiles DB and Forgotten password - by El Forum - 06-09-2009, 09:39 AM
Users and Profiles DB and Forgotten password - by El Forum - 06-09-2009, 10:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB