Updated SHA1 HexDigest method to avoid potential overflows, slightly improved speed.