CodeIgniter Forums
dohash sha1 diference - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: dohash sha1 diference (/showthread.php?tid=7069)



dohash sha1 diference - El Forum - 03-23-2008

[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?


dohash sha1 diference - El Forum - 03-23-2008

[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?


dohash sha1 diference - El Forum - 03-23-2008

[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 :-(