Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96194 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58047 invoked from network); 3 Oct 2016 12:06:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Oct 2016 12:06:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.46 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.218.46 mail-oi0-f46.google.com Received: from [209.85.218.46] ([209.85.218.46:35233] helo=mail-oi0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/D4-06241-9C942F75 for ; Mon, 03 Oct 2016 08:06:34 -0400 Received: by mail-oi0-f46.google.com with SMTP id w11so197033519oia.2 for ; Mon, 03 Oct 2016 05:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qXjYb5TIwWuhOVKK55NFAH1masuymuwAGYAzfl4ILQc=; b=dmW8r+PY8H/WHuNSjvbicCjodOoEMkcV6npfcxqG/MZ1yPVX3b3abUcz3CFfnRKhqw wOg/JsLOUH8hL5OAQwoMDjlyqflweZoePxEjnW+908s3Q5r3FbP2R9vqIwhipEs9Q5qP kFFASNOiuInzMCekzBdsn3VCZ7819UuyZh408MvrOslcuQRSpIRZiNkx8b1bFuOufqLM 7lp/vQpQONlv4+zKtuxskL+dq1RtAqA1ddBHb8E1J1H7zWJyrCLQyNbYehpFzQTZB/TV wUaEVpddZ8THzuKoEeZ8SCUPRUIQFFZHg8YVy0CjHO34+iX88UB1DhJNjnWiQQnVhJQI aBeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qXjYb5TIwWuhOVKK55NFAH1masuymuwAGYAzfl4ILQc=; b=GY2JNPwOzdJPPZdEvrTGelVMKk7TWQofx91KdPn1Hef1+WSCxeZdqs72E/wE001qBl fKrmh3NutHas3zu8+OIN3/F3wnnRh0rfIToKYqNnqyZDkdoQdd7y1TXfbldaq3hlb1xk Ylz+TCL6OGII/NxpUBc65KZXD3bjiR2i0GdDO9sptyKU0TaqVYjt7KPSWVc62CzP+jSJ V+CQjAbWceVsd0614Ef0dyL0hnnzGvumJpX3t+MWmQm+X88F58znJQyEfN7m5gWyGkNf SrioutYDueCffzKDsWLRI7WSWayQBV8a4cZ0urBz1Cexip04rx+2LlKZ6M4K78IbMM2u 2Icw== X-Gm-Message-State: AA6/9Rnom0GkuquHtYMOJUPSAueA9qlMPMc8ppFPdFS03M1aJM/iZvPB2U1HxemwbmF1m93e7LlAq7DknMyYvg== X-Received: by 10.202.213.195 with SMTP id m186mr11549403oig.63.1475496391442; Mon, 03 Oct 2016 05:06:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.60.199 with HTTP; Mon, 3 Oct 2016 05:06:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 Oct 2016 13:06:30 +0100 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] Improve uniqid() uniqueness From: leight@gmail.com (Leigh) On 2 October 2016 at 21:03, Yasuo Ohgaki wrote: > Hi all, > > On Mon, Oct 3, 2016 at 3:56 AM, Yasuo Ohgaki wrote: >> Besides improving "more entropy" the default and data, I prepared >> fully compatible patch to simplify discussion. >> >> https://gist.github.com/anonymous/fb615df325d559fa806a265031a06ede >> >> I would like to apply this patch from PHP 7.0 branch, then discuss what >> the default should be. >> >> Any comments? >> If there is no objections, I'll apply this few days later. > > Updated patch a little > > https://gist.github.com/yohgaki/cbe5431f9d072b57af2883a2b5745195 > > Exception should not be ignored, but added few lines for this. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > I'm curious, did you consider using random_int? It already handles biasing, and you can reduce the repeated calls to random_bytes.