• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Don't understand why CI_Encrypt is throwing an error when I invoke sha1()?

Hi, I'm new to CodeIgniter and I've been trying to use the Encrypt library, specifically the sha1 function to hash a user password. After the user registers I grab the password and pass it to sha1(). If I print the password and die, it prints the password, but if left to execute sha1 throws the error below. Anyone know what I'm doing wrong, or not doing? I also checked to see that the password is_string(). Also, the value returned from sha1() appears to always be 1.

// Code Snippet
$hash = $this->encrypt-sha1($this->input->post('password1'));

// Thrown Error
A PHP Error was encountered
Severity: Notice
Message: Object of class CI_Encrypt could not be converted to int

UGH! Never mind, it was a typo just before sha1(). That is an hour+ that I won't get back.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.