Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105022 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25961 invoked from network); 1 Apr 2019 08:49:04 -0000 Received: from unknown (HELO mail-wr1-f43.google.com) (209.85.221.43) by pb1.pair.com with SMTP; 1 Apr 2019 08:49:04 -0000 Received: by mail-wr1-f43.google.com with SMTP id q1so10187796wrp.0 for ; Sun, 31 Mar 2019 22:43:53 -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=d11sWMZ+HckWi5xuQKK9W4KRApksO1O1z6iAmVsQG3Q=; b=lkC6IphmvuhyD3FVhytGlZTpydZk0D49unwgZGhUxYJHCyX4spE3sOiePy+X9NEpaj 32z0COlQMqcscQYKIcfcojVQTVmLR6fAsKu7H5xA3qwQG8rls1cN83gnzYxDIccqvWNE rXIzYngBPS8OkttmtLkaweG9qq2cQdndbmAlhOuQs8Oth0RGPCf/03R4uJ+DmfjVjg+u t5DbCXoL+QnqHoS/YfFKQza7TewR3YR9mhvbNmfpZPjt5QhZWdYb81DW/HhYbMwTaiWl F6mnXl3vqn1nmRYhuToP381MDR3DULP1f/TN62h5W5QP5t7dEAOPhEGDQynlBuCNA2vF bztw== 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=d11sWMZ+HckWi5xuQKK9W4KRApksO1O1z6iAmVsQG3Q=; b=UyIsb0GAMdIaIoupb5Ya/XEE6Y2v8galreHUL7ygW+IrrJmhPBg5Xs/V1F8DY1heMn U/IpPl9gquYQywOI9eUulgLh681lToCDbNb/EinG4JYdd22xw5I5iwkbq9LAei5WWJU7 j2wZavf68WdswmjXeCX+McCqDcSW/sxDTkpSTnsCwgQHtqaNYqJKXsEZURucMlpG8stp I1rNNJl1zkKH3TinpfCNA7B9/FzmHp7uJjcPaTjWQx60n5GW7JHcNtBJt6hgy1Y8aymX RbzMyLL06zbncstvg9UFfhpcoXeH2pdOp4ssdFT3Dl/RfXF68AH2IYgkoNZaPoH/nXJ5 bf1w== X-Gm-Message-State: APjAAAVWs3v/0gi/u4EDUuHZUz7WIK2f8TpJ1/aUQkuPRpesgK8slNFa oKWshWDdBua0gjvsaeZylg9nYJezkcC21cBR/Jc= X-Google-Smtp-Source: APXvYqwHBqVqI9dflODk8Eo5iHseipxwyPbmDY55cE/3Z4GM5MSUvp83XVofYWinHJgF00rRTI96Jy/swhPtzQY9R6E= X-Received: by 2002:adf:f984:: with SMTP id f4mr36691287wrr.97.1554097432692; Sun, 31 Mar 2019 22:43:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 1 Apr 2019 08:43:43 +0300 Message-ID: To: David Rodrigues Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006c0a8805857181a8" Subject: Re: [PHP-DEV] random_seed() From: arvids.godjuks@gmail.com (Arvids Godjuks) --0000000000006c0a8805857181a8 Content-Type: text/plain; charset="UTF-8" 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. > --0000000000006c0a8805857181a8--