I've done SHA-1 before in pure perl (and it was slow). Unfortunately, I don't have access to the code anymore (nor
the time right now to re-do it). All I really did was
follow the standard (and use it's test cases) which can
be found on
website. Trying to implement the standard my make you swear
just as much but at least you'll have a greater reward at
the end.