public inbox for [email protected]  
help / color / mirror / Atom feed
From: Carl Sopchak <[email protected]>
To: Tom Lane <[email protected]>
Cc: [email protected]
Subject: Re: What seed does random() use if setseed() is not called first?
Date: Sat, 23 Jul 2022 17:55:40 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thank you for the quick reply!  But I wouldn't have bothered you
      if the documentation stated something to the effect of "While it's
      platform-dependent, if setseed() is not called, the random number
      generator is generally seeded by whatever method the operating
      system provides as a source of randomness, such as /dev/urandom on
      Linux/Unix, or &lt;???&gt; on Windows."</p>
    <p>Just a suggestion, hope this helps, and thanks again!</p>
    <p>Carl<br>
    </p>
    <div class="moz-cite-prefix">On 7/23/22 17:47, Tom Lane wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:[email protected]">
      <pre class="moz-quote-pre" wrap="">Carl Sopchak <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a> writes:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">    &lt;p&gt;There is one point about the documentation for random() and
      setseed() that is missing.  What is used to seed random() if
      setseed() isn't called first?  I assume it's something like
      /dev/random or /dev/urandom, but that's just a guess.  Can someone
      please enlighten me?&lt;/p&gt;
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
We don't document this because it's platform- and version-dependent,
but yeah, generally /dev/urandom or local equivalent.

			regards, tom lane
</pre>
    </blockquote>
  </body>
</html>





view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: What seed does random() use if setseed() is not called first?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox