protected function generateHash($length)
    {
        $token = '';
        for ($i = 0; $i < $length; ++ $i) {
            $rand = mt_rand(0, 35);
            
            if ($rand < 26) {
                $char = chr(ord('a') + $rand);
            } else {
                $char = chr(ord('0') + $rand - 26);
            }
            
            $token .= $char;
        }
        return $token;
    }