Re: note 64495 added to function.uniqid
| From: | Hannes Magnusson | Date: | Sun, 16 Apr 2006 21:26:26 +0000 |
| Subject: | Re: note 64495 added to function.uniqid | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-108281@lists.php.net to get a copy of this message | ||
I kinda find this useful note, but GPL licensed code in our notes?
What do you think?
- Hannes
On 4/16/06, maciej.strzelecki@gmail.com <maciej.strzelecki@gmail.com> wrote:
> This is an implementation of version 4 UUID, which is generating UUIDs from truly-random
> numbers.
>
> <?php
> /* Copyright 2006 Maciej Strzelecki
>
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation; either version 2 of the License, or
> (at your option) any later version.
>
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with this program; if not, write to the Free Software
> Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
>
> function uuid()
> {
> // version 4 UUID
> return sprintf(
> '%08x-%04x-%04x-%02x%02x-%012x',
> mt_rand(),
> mt_rand(0, 65535),
> bindec(substr_replace(
> sprintf('%016b', mt_rand(0, 65535)), '0100', 11, 4)
> ),
> bindec(substr_replace(sprintf('%08b', mt_rand(0, 255)), '01', 5,
> 2)),
> mt_rand(0, 255),
> mt_rand()
> );
> }
> ?>
> ----
> Server IP: 195.136.184.34
> Probable Submitter: 213.238.125.33
> ----
> X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
> autolearn=no version=2.64
> ----
> Manual Page -- http://www.php.net/manual/en/function.uniqid.php
> Edit -- http://master.php.net/note/edit/64495
> Del: integrated --
> http://master.php.net/note/delete/64495/integrated
> Del: useless --
> http://master.php.net/note/delete/64495/useless
> Del: bad code --
> http://master.php.net/note/delete/64495/bad+code
> Del: spam --
> http://master.php.net/note/delete/64495/spam
> Del: non-english --
> http://master.php.net/note/delete/64495/non-english
> Del: in docs --
> http://master.php.net/note/delete/64495/in+docs
> Del: other reasons-- http://master.php.net/note/delete/64495
> Reject -- http://master.php.net/note/reject/64495
> Search -- http://master.php.net/manage/user-notes.php
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>