finalized now uses a copy of the state to allow further hashing. Also moved to_hex to within the sha class and renamed it to_string