Just generate a random string (make sure to use the proper generator, e.g. <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;dchest&#x2F;751fd00ee417c947c252" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;dchest&#x2F;751fd00ee417c947c252</a>). If the result is shorter than, say 100 bits, you&#x27;ll have to check for collisions (e.g. unique constraint in database).<p>Alternatively, if you have 64-bit sequences as IDs (e.g. autoincremented ids in SQL database), you can encrypt then using a real 64-bit block cipher, such as Blowfish or XTEA, with a secret key known only to server. This can give you unsigned 64-bit numbers, which are usable in existing systems (except in JavaScript, where maximum integer has 53 bits), for example:<p><pre><code>   1 -&gt; 3491820675944448233
   2 -&gt; 9264994595240464886
</code></pre>
If you use base64 encoding, it will give you 11-character strings, e.g. &quot;0AdUgU8OZfo&quot;. Make sure to use URL-safe encoding, though (instead of +, &#x2F; it uses -, _).