<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.random-engine-xoshiro256starstar.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'random-engine-xoshiro256starstar.construct.php',
    1 => 'Random\\Engine\\Xoshiro256StarStar::__construct',
    2 => 'Constructs a new xoshiro256** engine',
  ),
  'up' => 
  array (
    0 => 'class.random-engine-xoshiro256starstar.php',
    1 => 'Random\\Engine\\Xoshiro256StarStar',
  ),
  'prev' => 
  array (
    0 => 'class.random-engine-xoshiro256starstar.php',
    1 => 'Random\\Engine\\Xoshiro256StarStar',
  ),
  'next' => 
  array (
    0 => 'random-engine-xoshiro256starstar.debuginfo.php',
    1 => 'Random\\Engine\\Xoshiro256StarStar::__debugInfo',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/random/random/engine/xoshiro256starstar/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="random-engine-xoshiro256starstar.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Random\Engine\Xoshiro256StarStar::__construct</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.2.0)</p><p class="refpurpose"><span class="refname">Random\Engine\Xoshiro256StarStar::__construct</span> &mdash; <span class="dc-title">Constructs a new xoshiro256** engine</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-random-engine-xoshiro256starstar.construct-description">
  <h3 class="title">Descrizione</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Random\Engine\Xoshiro256StarStar::__construct</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$seed</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>)</div>

  <p class="para rdfs-comment">

  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-random-engine-xoshiro256starstar.construct-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">seed</code></dt>
    <dd>
     <p class="para">
      How the internal 256 bit (32 byte) state consisting of four unsigned 64 bit integers is
      seeded depends on the type used as the <code class="parameter">seed</code>.
      <table class="doctable informaltable">
       
        <thead>
         <tr>
          <th>Type</th>
          <th>Descrizione</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td><span class="type"><a href="language.types.null.php" class="type null">null</a></span></td>
          <td>
           Fills the state with 32 random bytes generated using the <abbr title="Cryptographically Secure PseudoRandom Number Generator">CSPRNG</abbr>.
          </td>
         </tr>

         <tr>
          <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
          <td>
           Fills the state with four consecutive values generated with the SplitMix64 algorithm
           that was seeded with <code class="parameter">seed</code> interpreted as an unsigned 64 bit integer.
          </td>
         </tr>

         <tr>
          <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
          <td>
           Fills the state by interpreting a 32 byte <span class="type"><a href="language.types.string.php" class="type string">string</a></span> as four little-endian unsigned
           64 bit integers.
          </td>
         </tr>

        </tbody>
       
      </table>

     </p>
    </dd>
   
  </dl>
 </div>


 

 <div class="refsect1 errors" id="refsect1-random-engine-xoshiro256starstar.construct-errors">
  <h3 class="title">Errori/Eccezioni</h3>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     If the length of a <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">seed</code> is
     not 32 bytes, a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> will be thrown.
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     If a <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">seed</code> consists of
     32 NUL bytes (<code class="literal">&quot;\x00&quot;</code>), a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span>
     will be thrown.
    </span>
   </li>
  </ul>
 </div>


 <div class="refsect1 examples" id="refsect1-random-engine-xoshiro256starstar.construct-examples">
  <h3 class="title">Esempi</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>Random\Engine\Xoshiro256StarStar::__construct()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Uses a random 256 Bit seed.<br /></span><span style="color: #0000BB">$e </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Random\Engine\Xoshiro256StarStar</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$r </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Random\Randomizer</span><span style="color: #007700">(</span><span style="color: #0000BB">$e</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <div class="example" id="example-2">
   <p><strong>Example #2 Deriving a seed from a <span class="type"><a href="language.types.string.php" class="type string">string</a></span></strong></p>
   <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$string </span><span style="color: #007700">= </span><span style="color: #DD0000">"My string seed"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Hash the string with SHA-256 using binary output to turn the<br />// $string into a 256 Bit seed. Using the same string will result<br />// in the same sequence of randomness.<br /></span><span style="color: #0000BB">$e </span><span style="color: #007700">= new </span><span style="color: #0000BB">\Random\Engine\Xoshiro256StarStar</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">hash</span><span style="color: #007700">(</span><span style="color: #DD0000">'sha256'</span><span style="color: #007700">, </span><span style="color: #0000BB">$string</span><span style="color: #007700">, </span><span style="color: #0000BB">binary</span><span style="color: #007700">: </span><span style="color: #0000BB">true</span><span style="color: #007700">)<br />);<br /><br />echo </span><span style="color: #0000BB">bin2hex</span><span style="color: #007700">(</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">()), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">6e013453678388c2</pre>
</div>
   </div>
  </div>
 </div>



</div><?php manual_footer($setup); ?>