function PhpassHashedPasswordBase::getCountLog2

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php \Drupal\Core\Password\PhpassHashedPasswordBase::getCountLog2()

Parses the log2 iteration count from a stored hash or setting string.

Parameters

string $setting: An existing hash or the output of $this->generateSalt(). Must be at least 12 characters (the settings and salt).

Return value

int The log2 iteration count.

2 calls to PhpassHashedPasswordBase::getCountLog2()
PhpassHashedPasswordBase::crypt in core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php
Hash a password using a secure stretched hash.
PhpassHashedPasswordBase::needsRehash in core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php

File

core/lib/Drupal/Core/Password/PhpassHashedPasswordBase.php, line 243

Class

PhpassHashedPasswordBase
Legacy password hashing framework.

Namespace

Drupal\Core\Password

Code

public function getCountLog2($setting) {
    return strpos(static::$ITOA64, $setting[3]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.