Php 使用代码点火器实现SHA 512哈希
我有一个控制器:landingpage.phpPhp 使用代码点火器实现SHA 512哈希,php,codeigniter,sha512,Php,Codeigniter,Sha512,我有一个控制器:landingpage.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class LandingPage extends CI_Controller { public function index(){ $data = array( 'head' => $this->load->view('
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class LandingPage extends CI_Controller {
public function index(){
$data = array(
'head' => $this->load->view('Landing_Header', '', true),
'guts' => $this->load->view('Landing_Guts', '', true),
'foot' => $this->load->view('Landing_Footer', '', true)
);
$this->load->view('index', $data);
}
public function validateInput(){
#load help libraries for use
$this->load->helper("form");
$this->load->helper("form_validation");
/////////////////////////////////////////////////////////////////
/////////////////////// New User Validation /////////////////////
/////////////////////// Format for Validation : ////////////////
////////// "field name","Error Value","validation method" ///////
$this->form_validation->set_rules('fullname','Your Name','required|min_length[2]|max_length[20]');
$this->form_validation->set_rules('email','Your Email','required|valid_email|is_unique[users.email]');
$this->form_validation->set_rules('emailConf','Email Confirm','required|matches[email]');
$this->form_validation->set_rules('password','Password','required|min_length[2]|max_length[20]');
}
}
代码点火器有内置的功能吗???还是类似的
代码点火器有内置的功能吗
不需要,但既然PHP有,你就不需要了
hash('sha512', $string);
再简单不过了,再短不过了。为什么要重写现有的功能
但是,对于PHP中的哈希密码,我建议使用phpass:
没错。谢谢Madmartigan!如何使用代码点火器
$this->form\u validation
调用实现此目的?使用回调:
hash('sha512', $string);