public function generateRandomString($length = 32, $specialCharacters = true)
    {
        $digits = '';
        $chars = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789";

        if ($specialCharacters === true) {
            $chars .= "!?=/&+,.";
        }

        for ($i = 0; $i < $length; $i++) {
            $x = mt_rand(0, strlen($chars) - 1);
            $digits .= $chars{$x};
        }

        return $digits;
    }