Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110044 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10307 invoked from network); 6 May 2020 14:35:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 May 2020 14:35:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 059FC1804CB for ; Wed, 6 May 2020 06:11:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15716 95.128.32.0/21 X-Spam-Virus: No X-Envelope-From: Received: from mx.kolabnow.com (mx.kolabnow.com [95.128.36.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 6 May 2020 06:11:05 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTP id 05FFD404E7 for ; Wed, 6 May 2020 15:11:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:date:date:message-id:from :from:references:subject:subject:received:received:received; s= dkim20160331; t=1588770662; x=1590585063; bh=f8UBUoFkjWvOM9A1lmJ 3xh6zrcwBBT7D2XAHhyXzJOU=; b=RzfG5me22Y1i8Vhv/mnaBWQEsStSKTgVa+/ edbQhDL71VFjGp0/Rfkj5eu5B7g2Fzt1KJ1jjcIcLlmu8/hyS+zCF58Q8TobtANa +8BuUs+EJP8hPTxcrvOU7u47rXQWZhwmGmVEfIG+rF6xgInz9GPKVbcgSgShkijd 9R/U91YIMz4vvjJBfquP5BDhmtxcX+ovwTiGXRbF5lXTl9uecbXdlJF0N/Pgk1kr Hq2liEt4CHACJUFbEj5J/W799DvKcy/G76jXxwgxsMNki+oyiyCJE/MLXJpnN9cz B68ll+FW63kII+FbPX7Y8+FBJZKXg4Nk1aeUcB+PHpBi5wErAzk8ASNeCNjfkRFp umEM9DVERGg/atcsxOPyGU101FCMlN0jgUdW2GVOy0ScR+AWRYhZZBk66MaCkYVD SRDg3C+xaT+Fs1qRNL2e/+vMUooC1yfyArY5yPLLGpoHfQUxnNzJZWLYRsQ7YgLh UlM28I+JSP4W0HtMtUqJGo62nzx2ldLvtwqIujXy8JWtnldhaZYqN47D3bjKFPnE EbnuWCTmVLh4iC06woH8szOJAokE91EbAG4WJ02fPL/WoyGVca6PMueQSMx3JZRs nX6ra6Ne7IyA39Brz4nuUTLzn7U8ln3NRvJEnQWuM0KtNQ2BqXgJ8YkJ4vd8tmD6 pRfmBob8= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out003.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5XNPRpvwG189 for ; Wed, 6 May 2020 15:11:02 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out003.mykolab.com (Postfix) with ESMTPS id 54E1D403FB for ; Wed, 6 May 2020 15:11:00 +0200 (CEST) Received: from ext-subm002.mykolab.com (unknown [10.9.6.2]) by int-mx001.mykolab.com (Postfix) with ESMTPS id EE3CC381 for ; Wed, 6 May 2020 15:10:59 +0200 (CEST) To: internals@lists.php.net References: <9e3b1604-8d0a-9db4-aab6-e5f2198252f4@allenjb.me.uk> <3a2924d2-31b9-fee5-5548-49c889eca2f4@heigl.org> Message-ID: Date: Wed, 6 May 2020 15:10:58 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Deprecating uniqid() From: alec@alec.pl (Aleksander Machniak) 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