Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105024 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 73307 invoked from network); 1 Apr 2019 11:13:07 -0000 Received: from unknown (HELO mail-it1-f182.google.com) (209.85.166.182) by pb1.pair.com with SMTP; 1 Apr 2019 11:13:07 -0000 Received: by mail-it1-f182.google.com with SMTP id w15so13840721itc.0 for ; Mon, 01 Apr 2019 01:07:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8I9pDWTDq2EieeMw8vq+j5Wrah5NFy6vOZCG060/U+I=; b=W+euBkU3imYoRWTqd0mCbhPJB4fAgWz3WoU6jiq+bjuK3qzlT6Xh5knGZvHwL8solH 4slqPkPpW0n+K/LdkwbEDOB/g9945Ag3VmjAkyLYJMW7WFYWHK+gZ5fUEvuDgyRfxYhP hgdZ6wugjaQmyM4zUzLEZm/7UHUt491PdrzamKP8unKNlmYwQncQxiHLuez0wyHiUTVS iNa8FZDgXfGWcKNK731bdd2edcHI6UxRVR6eZsIT8GC3GYBv6WBsVDHk0hcfjxxH2TEP Bik1ZcqET6UZXeVSnI0CVA88EFKBodSlQp3iyEAFb3jqn3RFdUQGcMxyWRNvhHKcSYhe XgMQ== 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=8I9pDWTDq2EieeMw8vq+j5Wrah5NFy6vOZCG060/U+I=; b=GeuCyF9arBtGCGZ0B6Z/zpAEoncGPrQb4XO67M7+qF2XyrYP8bwKTdYS6A6ffuniq/ V0AdeJgS5s7HQ6v5m9Q4cYZGWnJdIaCUWKkAnCgIWJNc0id7cicvP6PvCN46PFdbdce5 rVKq6alJ4zpr4cWlAQ5tLoODzSkjJEtTjvvoBJrx1bk/3sxPh0Qshby1D4wv53VniB12 wgTElkLBhXGWr3MmhyMWUz+9VWhG7BDcKTeUTGNwu/lDhLr2nxDSYZXmMcqRF/inwrkw ubojDubaslZgBTgkWJaFtVaL/A1g1SClru6vLaVvj8DOmDN3VuyUBp9Vb8ZaNdx8odXp LxcA== X-Gm-Message-State: APjAAAWaOTS81P3p9/CIHHa2nQhUHw/qI2HRu68QkCIUUJGARpF6nIWU aNUBeAwCS82fy5BFhbD87k0Ljfi2LQ1SdZ1dvng= X-Google-Smtp-Source: APXvYqx+lXlP8VJH+diya0ilaGqjZncavvmQYMEOt9aau0+6vMsQ6rWCpNs5kv6UKi9nkDH5o2ZE+IXdwJRe91nCCn0= X-Received: by 2002:a02:88fc:: with SMTP id b57mr45899660jak.55.1554106077907; Mon, 01 Apr 2019 01:07:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 1 Apr 2019 10:07:47 +0200 Message-ID: To: Pierre Joye Cc: Arvids Godjuks , David Rodrigues , PHP internals Content-Type: multipart/alternative; boundary="000000000000b793190585738498" Subject: Re: [PHP-DEV] random_seed() From: benjamin.morel@gmail.com (Benjamin Morel) --000000000000b793190585738498 Content-Type: text/plain; charset="UTF-8" Seeds could even be dangerous here, as these numbers are supposed to be cryptographically secure. If you need a seedable PRNG for testing, just use rand(). Ben On Mon, 1 Apr 2019 at 09:57, Pierre Joye wrote: > Good afternoon, > > fully correct. Seeds are not needed anymore. > > > best, > > On Mon, Apr 1, 2019, 12:44 PM Arvids Godjuks > wrote: > > > On Mon, Apr 1, 2019, 05:52 David Rodrigues > wrote: > > > > > Just to know, can we have a random_seed() for > random_int()/random_bytes() > > > like we have mt_srand() to mt_rand()? > > > > > > I don't know if random_int() is more "random" than mt_rand(), but if it > > is, > > > so maybe is valid a random_seed() function. > > > > > > -- > > > David Rodrigues > > > > > > > Hello, > > > > random_bytes/random_int use proper random generation source - > /dev/urandom > > in most cases (and appropriate source on windows) - that's the whole > point > > why they were introduced. There is no need for seeds nor it can even be > > initialized with a seed. > > They are, as far as I understand, cryptographically safe random > generators. > > > > I suggest reading up on the subject, the RFC and the whole thing. Their > > introduction was well covered by various core devs in blog posts. > > > > > > > > --000000000000b793190585738498--