fixed a memory issue in sha1

The uhex and lhex functions of sha1hash did not properly convert the buffered
digest to a string. This caused the constructor of std::string to read past the
buffer's memory until a 0 byte was encountered.