Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110042 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 91131 invoked from network); 6 May 2020 14:05:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 May 2020 14:05:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 634441804E3 for ; Wed, 6 May 2020 05:40:48 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.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 ; Wed, 6 May 2020 05:40:47 -0700 (PDT) Received: by mail-vs1-f47.google.com with SMTP id x6so967375vso.1 for ; Wed, 06 May 2020 05:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cjRxmyX6Y5N07u25NvgWmMhwNx7CcIebdDf0yyKaI/4=; b=Y+i5C7EmBvZNLwI9IHMVrx53s1K20WNVgGOfEkuH79Y0GzUToqlIvLHZmbvbkj/g2w i4FEu14PIm2/8c4ZBLXLEZynaOXFZeowcpaJghPo1Q/FxJSnQqeZGXFJzC9lbSFEfvx3 rc4y+sWAmcVtQOGu5n+0KZ9gYmlp0t2cqLHSNSbk7l4Vd6ab8lzeP/lHt21BMrbHaMpa KgkFwUl+gY1yI6hjKV0UMB8he8W7Q9l3p/KNG+pxvGMEL+/5bHfEIoA5N4W5ngfYVu/6 GyxUU7ucSagIpSRW0BId+vc6MKpBpVsMKnUIEjqaYVYwMO0Io6MP+3tWiiPKZSw32HW1 k02g== 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:cc; bh=cjRxmyX6Y5N07u25NvgWmMhwNx7CcIebdDf0yyKaI/4=; b=Do7njURyplI0y9tdf9GSYUjdBQgv9zzm98tgcYsT5u0V3+HrYk/98gdvLij5h1WcLP cEkZlQDAvrRQ53VkiMQBhsoemT940wNlyT+wUuH0LSUk7PWCWZXhV/v1W+x8BUH8qZqy 2NEPtMRvwUlFD3/4AaV7+r1Qyb1iLKaPqZPbGLxMqqcfJnnah5rURiOl6Od37xV2atNM Q+cIi3dYuDB/4gEuHmc2DHurKtmILBCGvUGzUfamrLpxCfm8lRQp3tbufE8RaZB1hHr4 abkhtEGBFauNSs2W4+ryHsZWU38u48nJYzY/Q/4HflbhujwmE3WfPhDenlJ4XENHqOVz Q3qA== X-Gm-Message-State: AGi0PuapvaubTAxeUkaKLIsVQ1SnqC7nufY1e5yFx9j2Z5O8R6v7KwYu xldYpfHYg6xVBludvEB+rylwPmOJQuLrrfn88cPbGg== X-Google-Smtp-Source: APiQypLeznMlFOyGjruUocmc7oSE/zD9yoCL7rdg0SzbZwLNr3rKg/DLgzm4Kfoo/FEnxvc4OrbyXvhOdksA9l+W7MA= X-Received: by 2002:a67:334a:: with SMTP id z71mr7428336vsz.87.1588768844453; Wed, 06 May 2020 05:40:44 -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: Wed, 6 May 2020 13:40:33 +0100 Message-ID: To: Rowan Tommins Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Deprecating uniqid() From: Danack@basereality.com (Dan Ackroyd) On Wed, 6 May 2020 at 13:34, Rowan Tommins wrote: > > On 5 May 2020 09:42:19 BST, Arvids Godjuks wrote: > >So in my opinion, a better replacement for uniqid is needed - > > You're right that the requirements for "random" and "unique" are distinct. Perhaps what we need is a unique_string function that allows you to specify the format (length and some control over allowed characters) and uses This is a problem that would be better solved in userland rather than trying to design and evolve inside core PHP. And already has a very good solution: https://hashids.org/php/ That library is, in my opinion, a much better solution for the vast majority of people who are (mis)using uniqid. cheers Dan Ack