Newer Version Available

This content describes an older version of this product. View Latest

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.

If you used the API to create or update field values, the newline characters supplied by the application are honored and stored in Salesforce without further transformations.

Windows systems represent the newline character as a carriage return and line-feed character sequence (\r\n). UNIX and UNIX-based systems, like macOS and Linux, represent the newline character as a line-feed character (\n).

Note