Sorry I haven't been able to look into this.
I suspect that the issue is that when you create new-lines in your .net code you're getting a \r\n instead of \n and that's what's causing the hashes to be different.
I'll prolly look further into this later, but for this use-case I really suggest that you do all the low level operations in an extension action.
ssData = ssData.Replace("\r\n", "\n");
Following the rest of the function exactly the same, my outputted SHA256 hash now matches what I expect.
Do you think this can be added to the function? (If it makes sense for all use cases) Or parameter based?
Thanks very much for the help!
I don't think this transformation makes sense to be added to the Compute Hash function.
Normalization of the input is something that should be done before passing it to the hash computation.