Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72028 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49786 invoked from network); 3 Feb 2014 01:34:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2014 01:34:33 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:54015] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/D7-30967-822FEE25 for ; Sun, 02 Feb 2014 20:34:32 -0500 Received: by mail-lb0-f170.google.com with SMTP id u14so4917879lbd.15 for ; Sun, 02 Feb 2014 17:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=72+L6BrE/DPWCpbzyJuelH28Db9x93qoJ59JImiIi9A=; b=bjSSes9jORZn0c5HdRLeGYzdtH/NLi+DPWOZYZzpT8QXaWWPFaBkYX/UOMNjs1p6sY EbzQYQmqz1D1ewp2ejLRfjoQTKyKfdOtLLFfSihtz9xhqyJMcaKs66lUbU2UoDWIveY8 K67apHzP2p9IEt1i8xZER3vfv/LcQfec0dVKt/GMUbi3TXiR16a62nl7VJzmcli2m+pF wjV1FN6OLdsNxTC4/TzbRlfAetfDCDNd0wdN+cDW1masFiGIavel38YG5iFVqO95vw+V toX8TnPk9RSfBaX1AtLJ85npOBXFG4iiwTuV48fB7GBg/0uiOS4GbrtikH5rYfTLNmRo WW0Q== X-Received: by 10.152.120.37 with SMTP id kz5mr3224706lab.30.1391391268596; Sun, 02 Feb 2014 17:34:28 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Sun, 2 Feb 2014 17:33:48 -0800 (PST) In-Reply-To: References: <52EDF552.4010208@divbyzero.net> Date: Mon, 3 Feb 2014 10:33:48 +0900 X-Google-Sender-Auth: 266WRuFcT-QmsmODUmiEpF-ZHHE Message-ID: To: Tjerk Meesters Cc: Martin Jansen , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e012281484ef1fa04f1768667 Subject: Re: [PHP-DEV] Extending uniqid() or not? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e012281484ef1fa04f1768667 Content-Type: text/plain; charset=UTF-8 Hi all, On Mon, Feb 3, 2014 at 10:13 AM, Yasuo Ohgaki wrote: > On Mon, Feb 3, 2014 at 8:55 AM, Tjerk Meesters wrote: > >> I think it would be good enough to have only uuid v4: >> >> function uuidv4() >> { >> $data = openssl_random_pseudo_bytes(16); // or whatever >> >> $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010 >> $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 >> >> return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); >> } >> >> It's really just a representation of random data, whereby 6 bits are used >> for the actual format. >> > > I agree. > UUID v4 simply generate random ID and it is good for many purposes. > > My concern is portability. OpenSSL(or Mcrypt) is provided as module. > Users tends not to use module functions whenever possible. To address > this issue, OpenSSL could be a module compiled by default. > > Security matters for all applications. Compiling OpenSSL by default would > be nice to have. > > Any comments? > It seems consensus here is "Not to add new function" and "Improve documents". We are better to provide realistic alternative for application developers. I would like to write a RFC that makes openssl module a module compiled by default. Any comments for this? -- Yasuo Ohgaki yohgaki@ohgaki.net --089e012281484ef1fa04f1768667--