This actually generates a small error in the hex string (without cascading) for a few of my files, which usually involves outputting fewer than 40 characters, I narrowed it down to the transcription part of the code:
PHP Code:
SHA1Finalize(Context[SHA1Context], String:output[], bool:bHex)
{
if(bHex)
{
for(new i=0;i<5;i++)
// Originally: Format(output, 41, "%s%x", output, Context[Message_Digest][i]);
Format(output, 41, "%s%08x", output, Context[Message_Digest][i]);
...