<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sodium.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.sodium-crypto-pwhash-str-needs-rehash.php',
    1 => 'sodium_crypto_pwhash_str_needs_rehash',
    2 => 'Determine whether or not to rehash a password',
  ),
  'up' => 
  array (
    0 => 'ref.sodium.php',
    1 => 'Sodium Functions',
  ),
  'prev' => 
  array (
    0 => 'function.sodium-crypto-pwhash-str.php',
    1 => 'sodium_crypto_pwhash_str',
  ),
  'next' => 
  array (
    0 => 'function.sodium-crypto-pwhash-str-verify.php',
    1 => 'sodium_crypto_pwhash_str_verify',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sodium/functions/sodium-crypto-pwhash-str-needs-rehash.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.sodium-crypto-pwhash-str-needs-rehash" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sodium_crypto_pwhash_str_needs_rehash</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.2.0, PHP 8)</p><p class="refpurpose"><span class="refname">sodium_crypto_pwhash_str_needs_rehash</span> &mdash; <span class="dc-title">Determine whether or not to rehash a password</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sodium-crypto-pwhash-str-needs-rehash-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sodium_crypto_pwhash_str_needs_rehash</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$password</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$opslimit</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$memlimit</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Determine whether or not to rehash a password, based on the current hash <code class="parameter">opslimit</code> and <code class="parameter">memlimit</code>.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.sodium-crypto-pwhash-str-needs-rehash-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">password</code></dt>
    <dd>
     <span class="simpara">
      Password hash
     </span>
    </dd>
   
   
    <dt><code class="parameter">opslimit</code></dt>
    <dd>
     <span class="simpara">
      Configured opslimit; see <span class="function"><a href="function.sodium-crypto-pwhash-str.php" class="function">sodium_crypto_pwhash_str()</a></span>
     </span>
    </dd>
   
   
    <dt><code class="parameter">memlimit</code></dt>
    <dd>
     <span class="simpara">
      Configured memlimit; see <span class="function"><a href="function.sodium-crypto-pwhash-str.php" class="function">sodium_crypto_pwhash_str()</a></span>
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sodium-crypto-pwhash-str-needs-rehash-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> if the provided memlimit/opslimit do not match what&#039;s stored in the hash.
   Returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if they match.
  </p>
 </div>



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