Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109999 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32814 invoked from network); 5 May 2020 09:51:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 5 May 2020 09:51:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2B2371804F3 for ; Tue, 5 May 2020 01:26:04 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 5 May 2020 01:26:03 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id k18so285297ion.0 for ; Tue, 05 May 2020 01:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=7vluMPiCpeNhTFrVr+vwP0jwjMYYeMIKMAgLFhroV7U=; b=IHtGnlpBrgHzMn3Tx8cFkIfeFX/Uev4hwxNgt2RfXW07a32sj+Y55hDGw+r5UyqgL7 UL3MYAkWtOUH2VC+pxL7cuZNN66l9eJu+17u43M80dEtKyPH155r2MVR+i2L0ZdmO+16 vxU7Q7n7tX9uXna+u5zVjG3XvK53/q7UJ7shyOh5nRd8kWaICcRcLIB+Q9ok7qlCbKqz RdPucuJJgTz35qq0D4shcfnnbHofpp/548b8YD16py+u6Elw2L8GLRJ/DB8VbIGzD57F EEl8QZjJGJoYlDcxjqzCMLHvaMjIIUh3TKucRGFfNpljxA8x7Xp6cGhxNnxNVLLW2fJg sbRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=7vluMPiCpeNhTFrVr+vwP0jwjMYYeMIKMAgLFhroV7U=; b=fCuTHZh4tt3FOlit2ayoWrDcdvlByG9/QDYFlQQ4SQrlp5wDn3R5b92PhNRX11lKt1 GVbEjkLY39C8DpPscFa4kg0wI4Oyymt+xBeYMEhg+zHkMEWzJqdQr61dsnHW7qxP+t7F a3VR/q+1lTMK6tNAdCw9y6/KwEEe/pzIIsmw7PPeY/7mYnQ0X3igEDoIWu2ZNulrE4JK Ds89EIVChGOoyI8rTqbrsKE+CEafZBqgvQNHrMZwl6vHdrzIICvQei8z+V4yZP3MKI03 Ah/t6OHraGxwvspA88NV+AGgqKwumSOJ3srnRAvWd8Vm7Ff/bfkn3pJnu1JEQYA0Qp0k ONbA== X-Gm-Message-State: AGi0PubW1/lfuuuBe2KgHb/s/sHfB1bm+sAVeJqGfB5tO9EknVlaS5B8 G4PHnWcGZii3zbviMYyF9MiNHTHrsWfhox8GuwZXMg== X-Google-Smtp-Source: APiQypKMZySN9ktTS+YeXi4RGt2rt3aMM2xKiFp68q9fWocs25vBp46T7tMm9gCEvNEwLY6SH4nOqdXoLOkaUU3VYRY= X-Received: by 2002:a02:7611:: with SMTP id z17mr2427557jab.42.1588667162324; Tue, 05 May 2020 01:26:02 -0700 (PDT) MIME-Version: 1.0 References: <9e3b1604-8d0a-9db4-aab6-e5f2198252f4@allenjb.me.uk> <3a2924d2-31b9-fee5-5548-49c889eca2f4@heigl.org> In-Reply-To: Date: Tue, 5 May 2020 09:25:49 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000e0734e05a4e2650e" Subject: Re: [PHP-DEV] Deprecating uniqid() From: rowan.collins@gmail.com (Rowan Tommins) --000000000000e0734e05a4e2650e Content-Type: text/plain; charset="UTF-8" On Tue, 5 May 2020 at 08:52, Peter Bowyer wrote: > > On Tue, 5 May 2020 at 07:38, Niklas Keller wrote: > >> Rowan Tommins schrieb am Mo., 4. Mai 2020, >> 10:59: >> > Although the name sounds similar, I don't think UUID would be a good >> > replacement for uniqid(). In my experience, it's used for things like >> > generating ID attributes for HTML elements, or suffixes for table >> names, or >> > even file names; applications that really just need a few alphanumeric >> > characters that are different each time. >> >> Seems like UUIDs would be a good fit for all of these. >> > > For file names, absolutely. In many cases they have to be unique across > all processes, and that's important. For the others I say a UUID is only a > good replacement if taking a substring of a UUID is going to be unique. > As well as being nearly 3 times as long as the current uniqid() output, a UUID is generally formatted with hyphens, which may be disallowed or require careful quoting in various contexts. If you have to strip those out, or otherwise manipulate the result to fit the use case, you've failed at the original aim of having a single function that doesn't need further processing. (Leaving aside the fact that we don't actually have any UUID functions in core.) Regards, -- Rowan Tommins [IMSoP] --000000000000e0734e05a4e2650e--