//create slat
$salt = substr(sha1(time()),0,4);
//create token
$token = sha1($r['id'] . $salt);
//hash password
$password = sha1($salt . sha1($password));
$salt = substr(sha1(time()),0,4);
//create token
$token = sha1($r['id'] . $salt);
//hash password
$password = sha1($salt . sha1($password));