Welcome Guest, Not a member yet? Register   Sign In
Don't understand why CI_Encrypt is throwing an error when I invoke sha1()?
#1

[eluser]mtpultz[/eluser]
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
Code:
$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
#2

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




Theme © iAndrew 2016 - Forum software by © MyBB