private function getNonce($length = 20)
    {
        $parts = explode('.', number_format(microtime(true), 22, '.', ''));
        if (! isset($parts[1])) {
            $parts[1] = 0;
        }
        $nonce = base_convert($parts[1], 10, 36);

        for ($i = 0; $i < $length - strlen($nonce); $i++) {
            $nonce .= base_convert(mt_rand(0, 35), 10, 36);
        }

        return $nonce;
    }