Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用代码点火器实现SHA 512哈希_Php_Codeigniter_Sha512 - Fatal编程技术网

Php 使用代码点火器实现SHA 512哈希

Php 使用代码点火器实现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('

我有一个控制器: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('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);