ID:               26485
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dietrich at pegestorf dot de
-Status:           Open
+Status:           Assigned
 Bug Type:         *General Issues
 Operating System: linux
 PHP Version:      4.3.4
-Assigned To:      
+Assigned To:      derick
 New Comment:

I'll have a look at fixing this...


Previous Comments:
------------------------------------------------------------------------

[2003-12-01 07:41:35] dietrich at pegestorf dot de

Description:
------------
I try to generate a sha1 hash with sha1()

$hash = sha1("test");

$hash is calculated wrong to:
"a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"

I have a file /tmp/data with the word "test" in it (no carriage return
at the end)

$hash = sha1_file("/tmp/data");

$hash is calculated right to:
"4e1243bd22c66e76c2ba9eddc1f91394e57f9f83"

let's go tho the command line and enter:

echo test | openssl dgst -sha1

this generate also "4e1243bd22c66e76c2ba9eddc1f91394e57f9f83"

same than

openssl dgst -sha1 /tmp/data

If I generate the hash over "test\n" with the sha1() the hash is
calculated right to "4e1243bd22c66e76c2ba9eddc1f91394e57f9f83"  



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26485&edit=1

Reply via email to