On 06.05.2020 14:44, Nikita Popov wrote:
> A possible candidate for this would be ULID (https://github.com/ulid/spec),
> which is basically timestamp + random + base32 encoding. The timestamp part
> makes ULIDs approximately lexicographically orderable, the random part
> makes sure things are unique when generated in parallel and the base32
> encoding avoids people having to deal with raw binary data.

Something like that. Here's some points imho are important for the
implementation:

1. The random part does not exhaust system entrophy (based on mt_rand()?).
2. it's fast.
3. it's simple, i.e. is a simple function that returns base32 string.
The only argument might be the output string length.

My 2 cents.

-- 
Aleksander Machniak
Kolab Groupware Developer        [https://kolab.org]
Roundcube Webmail Developer  [https://roundcube.net]
----------------------------------------------------
PGP: 19359DC1 # Blog: https://kolabian.wordpress.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to