Takes the output of scryptsalsa208sha256 and compares it against
    a user provided password to see if they are the same

    :param password_hash: bytes
    :param password: bytes
    :rtype: boolean

    .. versionadded:: 1.2
500808
def verify(password_hash, password):
    

    ensure(len(password_hash) == PWHASH_SIZE,
           "The password hash must be exactly %s bytes long" %
           nacl.bindings.crypto_pwhash_scryptsalsa208sha256_STRBYTES,
           raising=exc.ValueError)

    return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_str_verify(
        password_hash, password
    )
864332
def check(self, password: str) -> bool:
        
        return (
            pbkdf2_sha512.verify(password, self.password) or
            pbkdf2_sha512.verify(password,
                                 pbkdf2_sha512.encrypt(self.api_key))
        )
759388
def compare(crypted_string, plain_string)
      BCrypt::Password.new(crypted_string).is_password?(plain_string)
    rescue BCrypt::Errors::InvalidHash
      false
    end
1260180
def CompareTo(self, other_hash_value):
        
        if len(self.hash_value) != len(other_hash_value):
            raise ValueError("Length of hashes doesn't match.")

        # The hash byte array that is returned from ComputeHash method has the MSB at the end of the array
        # so comparing the bytes from the end for compare operations.
        for i in xrange(0, len(self.hash_value)):
            if(self.hash_value[len(self.hash_value) - i - 1] < other_hash_value[len(self.hash_value) - i - 1]):
                return -1
            elif self.hash_value[len(self.hash_value) - i - 1] > other_hash_value[len(self.hash_value) - i - 1]:
                return 1
        return 0
939833
def get_common_session_key_proof_hash(self, session_key, session_key_proof, client_public):
        
        return self.hash(client_public, session_key_proof, session_key, as_bytes=True)
874672
public static function passwordVerify(string $password, string $hash): bool
    {
        return (Str::length($hash) > 0 && password_verify($password, $hash));
    }
948247
def get_common_password_hash(self, salt):
        
        password = self._password
        if password is None:
            raise SRPException('User password should be in context for this scenario.')

        return self.hash(salt, self.hash(self._user, password, joiner=':'))
1176824
def hash_password(plain_text):
        """"""
        # NOTE: despite the name this is a one-way hash not a reversible cypher
        hashed = pbkdf2_sha256.encrypt(plain_text, rounds=8000, salt_size=10)
        return unicode(hashed)
100285
def authenticated?(password)
      if password_object == password
        update_hash!(password) if password_object.stale?
        return true
      end

      return false
    end
650634
public static function comparePasswordToHash( $plainText, $hash ) {
		if ( self::isBlowfishHash( $hash ) ) {
			$check = crypt( $plainText, $hash );

		} else {
			// horrible unsalted md5 that legacy app used for passwords
			$check = md5( $plainText );
		}

		return self::hashEquals( $hash, $check );
	}
31581
def verify(password, hash):
    
    _, algorithm, cost, salt, password_hash = hash.split("$")

    password = pbkdf2.pbkdf2_hex(password, salt, int(cost) * 500)

    return _safe_str_cmp(password, password_hash)
309400
protected function verifyPassword($password, $hash)
    {
        // Check plain password.
        if($password === $hash){
            return true;
        }
        // Check md5 hash
        if (md5($password) === $hash) {
            return true;
        }
        // Check bcrypt hash
        return password_verify($password, $hash);
    }
172481
def hash_input(inpt, algo=HASH_SHA256):
    """"""
    if (algo == HASH_MD5):
        hashcode = hashlib.md5()
    elif (algo == HASH_SHA1):
        hashcode = hashlib.sha1()
    elif (algo == HASH_SHA224):
        hashcode = hashlib.sha224()
    elif (algo == HASH_SHA256):
        hashcode = hashlib.sha256()
    elif (algo == HASH_SHA384):
        hashcode = hashlib.sha384()
    elif (algo == HASH_SHA512):
        hashcode = hashlib.sha512()

    if sys.version_info.major == 2:
        inpt = bytes(inpt)
    else:
        inpt = bytes(inpt, "utf-8")

    hashcode.update(inpt)
    hexhash = hashcode.hexdigest()
    return hexhash
844404
function passwordVerify($password, $hash) {
        if (!function_exists('crypt')) {
            trigger_error("Crypt must be loaded for password_verify to function", E_USER_WARNING);
            return false;
        }
        $ret = crypt($password, $hash);
        if (!is_string($ret) || $this->_strlen($ret) != $this->_strlen($hash) || $this->_strlen($ret) <= 13) {
            return false;
        }

        $status = 0;
        for ($i = 0; $i < $this->_strlen($ret); $i++) {
            $status |= (ord($ret[$i]) ^ ord($hash[$i]));
        }

        return $status === 0;
    }
894656
def is_password(self, is_password):
        

        if is_password:
            self.is_forgetable = True

        self._is_password = is_password
1131988
def use_double_hash(self, password_hash=None):
        
        single_hash = current_app.config.SECURITY_PASSWORD_SINGLE_HASH
        if single_hash and self.security.password_salt:
            raise RuntimeError('You may not specify a salt with '
                               'SECURITY_PASSWORD_SINGLE_HASH')

        if password_hash is None:
            is_plaintext = self.security.password_hash == 'plaintext'
        else:
            is_plaintext = \
                self.security.pwd_context.identify(password_hash) == 'plaintext'

        return not (is_plaintext or single_hash)
1221577
def verify_hash_type(self):
        '''
        
        '''
        if self.config['hash_type'].lower() in ['md5', 'sha1']:
            log.warning(
                'IMPORTANT: Do not use %s hashing algorithm! Please set '
                '"hash_type" to sha256 in Salt %s config!',
                self.config['hash_type'], self.__class__.__name__
            )