Ensure consistent ordering of encodings