Calculate sha1 hash of a string