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.
Ricardo, thanks in advance for any pointers.
I am having a similar mismatch on hashes:
Outsystems HASH = HEX: D4AB222EBA33E27C5F6C4AA8D1CA0CEBCBD0AEE6D8C405CA8A153A72D6CC0792
3rd party HASH =
My Logic below, input is coming from File upload widget:
Unfortunately I don't think I have any magic solution for you. My implementation of ComputeHash takes a string, converts it to bytes using UTF-8 encoding, and returns the hash of those bytes.
What's likely happening here is that the "convert-to-bytes" part on the 3rd party is different.
Another thing that could be happening is that the BinaryToText is not using the right encoding and is mucking up the text.
A third option is also that your 3rd party is not using sha256.
In order to properly help you with this, is it possible for you to share any documentation you have on how the 3rd party is doing the hashing?