Welcome Guest, Not a member yet? Register   Sign In
dohash sha1 diference
#1

[eluser]HrvojeKC[/eluser]
Hi!
I stumbled acros this diference in codeigniter:

If you echo the same string with dohash() and sha1() there is a tiny diference - the '0' at the end of the sha1() string!

Code:
echo 'dohash:<br>'.dohash('Hrvoje');
echo '<br>';
echo '<br>';
echo 'sha1:<br>'.sha1('Hrvoje');

I get:

dohash:
cdc84bff3d4530ff7642f446387ce850631f1251

sha1:
cdc84bff3d4530ff7642f446387ce850631f12510



Is this normal, intended or a bug?
#2

[eluser]Seppo[/eluser]
Well... it could be a bug, however I can not reproduce it with the same code. Are you sure you have no "0" output after it?
#3

[eluser]HrvojeKC[/eluser]
Thanks for the quick replay!
And yes it is a bug - but not in CI Smile

I accidentally left some debugging code, and it echoed that zero at the end :-(




Theme © iAndrew 2016 - Forum software by © MyBB