Newer Version Available
Considerations for Newline Characters and Computing the SHA-256 Hash
The content that Salesforce uses to generate the SHA-256 hash might have newline
characters transformed by the browser. Many browsers transform newline characters to \r\n in record field values before records are stored in
Salesforce. Also, Salesforce trims leading and trailing white spaces in field
values.
Before you generate the SHA-256 hash value, ensure that the reconstructed content from the diff contains the same newline characters as the original content and that no new leading or trailing white spaces are added. For example, when you save the content in a file, the operating system can add a trailing white space character.