当前位置 : 主页 > 网络编程 > PHP >

php哈希加密和验证

来源:互联网 收集:自由互联 发布时间:2021-06-28
Password.php self::COST]);if(password_needs_rehash($passwordHash, self::HASH, ['cost'=self::COST])){$passwordHash = self::hash($password);}return $passwordHash;}public static function verify($password, $passwordHash){if(password_verify($pas
Password.php
 self::COST]);
		if(password_needs_rehash($passwordHash, self::HASH, ['cost'=>self::COST])){
			$passwordHash = self::hash($password);
		}
		return $passwordHash;
	}

	public static function verify($password, $passwordHash){
		if(password_verify($password, $passwordHash)) return true;
		return false;
	}
}
网友评论