Hi Brian,
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 =
HEX: 98EC3A03729E8B945E72949A09F61A91185A6E151F130C9877E719C689A9EAB1
My Logic below, input is coming from File upload widget:
I had the same issue, and this solution helped me..---In my Case, I needed to do a file checksum SHA1, I used the ComputeHash action from CryptoAPI and I was having a different output and then I used the function BinatyToText and the checksum result is as supposed to be.---Note: make sure you are comparting the right ComputeHash outputs. There are 2 types (HEX and Base64)---Solution:--------the code:-----Actually I was using the Component: Powershell Commander to do this this File SHA1 checksum and was working perfect until someone change configuration in the server and this issue happens "powershell-commander-powershell-commander-error-method-not-found-simpleimp/"---Basically, @cesar mateus, suggest me to do a work this, 1- Go to the folder and download the file, using the Extension FileSystem2- Copy the file to my temporary files in my machine3- Then, with the file in our side, we can run the powershell command
Actually, findout that using the BinaryToText function in the ComputeHash doesn't work. It needs to be assing to a variable before like this
Hello Allen,
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?
Best regards,
Ricardo Silva
I think I found the way around this issue with the newline: use
SyntaxEditor Code Snippet
Chr(10)
functiion instead of newline()