Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109979 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 12034 invoked from network); 3 May 2020 17:29:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 May 2020 17:29:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A83CE1804C2 for ; Sun, 3 May 2020 09:04:03 -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.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, 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-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 ; Sun, 3 May 2020 09:04:03 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id x25so5600867wmc.0 for ; Sun, 03 May 2020 09:04:03 -0700 (PDT) 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=ZY3fKnKyzIIlqUaORL/ZCTt3oCi+0b6YlGlC0DjqLJg=; b=DdZJFFCJ2QgEPP84gyBqvl9dtCR7vssw7n37faUn+/heagX2p4j5RZNk7VHgEPySTp 2lGzxEASh77If4SG3XKy71VSZ6RtuwAp+mlnD4TtOxn6WP96x7OPA7rM3dW0E3yjZJQv DEqumwPKOj/Y0XaXZP2GdJgHoMF8jIQ20f0/C5Nkka6uwNGH7eoflf1csJvWlK5Fbges VvKqZ5GHy3Q/uFHcwMnyVwi+N8+yrv4j7doUseG7l00zL1NsLwXFIRO2uT9B9sRFg6FC xW/jMYKUHbzVTyacXR/DDDJ9qO31V2E5SfdWwYKAyLW1rdOQzocown6l9fXufoiH62Su 0PDA== X-Gm-Message-State: AGi0Pub0hcYyuW3llssIDk0qu9PVdpNiHQVkcOK726hS+59RkS0DGOVn E2Ezn35CTpCLrAVwmuLnV82+/g8OEjOzjeuyAHDZIpwS X-Google-Smtp-Source: APiQypLrhTsCawxi/f5po/OLEkTuafxJi2jqH+U8K/+nlfBO0VItMAUrrwNaEsRMHi/e7vECFzlrtzp0Mvltppsynwg= X-Received: by 2002:a1c:4e12:: with SMTP id g18mr9847833wmh.11.1588521839400; Sun, 03 May 2020 09:03:59 -0700 (PDT) MIME-Version: 1.0 References: <9e3b1604-8d0a-9db4-aab6-e5f2198252f4@allenjb.me.uk> <2ce8d735-b1d8-8c09-3b76-8d8176b1344a@gmail.com> In-Reply-To: <2ce8d735-b1d8-8c09-3b76-8d8176b1344a@gmail.com> Date: Sun, 3 May 2020 18:03:47 +0200 Message-ID: To: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Deprecating uniqid() From: jakob@givoni.dk (Jakob Givoni) On Sun, May 3, 2020 at 2:57 PM Rowan Tommins wrote: > > A common suggestion is to use binhex(random_bytes($desired_length / 2)), > which isn't particularly elegant, and in my experience, the main > requirement is "a unique string of printable/alphanumeric characters, so > limiting to [0-9a-f] is just limiting entropy for no reason. > Yes, a base_convert(..., 16, 32) around that would help but I'd really prefer a simple function than a chain of 3 functions (even if we had Larry's pipe operator :-p)