Can anyone explain why HexEncode ( CryptDigest ( "" ; "SHA256" ) ) works in FileMaker 17 but not in FileMaker 16?
I think this was an issue addressed in 17. In 16 I have been using the hard coded string since it is always the same.
The only one thing different between the two tests as shown on screen captures is that the top most is in the context of Demo, but the bottom one is context less. I get that the calculation does not address anything in the context, but just wonder.
Another test you may do in 16 would be to create a script with the same calculation, set error capture and see if you do get an error.
Thanks, same result regardless of context (I tried switching both). Also not seeing a script error.
Looks like a bug to me. I got the same results in FMP 16 here.
But .... when I do the same logic in Java (with about the same amount of code), I get:
So, if you used a micro-service, you immediately get rid of this bug by deferring this calculation to a known-good API that's used by millions every day.
In my own micro-service(s), I normally use SHA512 and add "salt" to help defeat "rainbow tables". All easy if you control your own code -- which you do when you write your own micro-services.
Rainbow table - Wikipedia
Below are examples of calling my standard micro-service logic passing an empty string like you did and saying "false" to add salt (so we match FMP):
Here's a call from POSTMAN (no FileMaker required, though can EASILY be called from FIleMaker too) for SHA 256:
(pass empty string using double quotes)
Here's a call from POSTMAN (AFAIK --> FMP still does not support SHA-512, so here's another huge micro-service bonus!) for SHA 512
And, of course, since we control the code, we add error handling so no maddening "?" FMP symbols:
For more information about micro-services, see my tutorials at:
Create Micro-Services Using Java and the Spark Java Framework
The Simplest Micro-Service! (Python and Flask)
I thought FMP 16 was still a supported product so where is the bug fix?
Another related question: does 17 support SHA-512 now?
If not, the micro-service does and has since, well, forever.
You have a different definition of "supported" than FileMaker inc. does. The only time that I've seen them release bug fixes for any version other than the current one is for a very, very few that were creating a great many complaints from their customer base due to the bug generating very, very serious problems for those affected by the bug.
My definition is not to have to upgrade to get bug fixes in supported versions (where it seems, as this particular bug demonstrates, new bugs are introduced as well for the "next" version's upgrade...)
But, within FileMaker, I don't use FileMaker itself for these kinds of functions so I am never affected by these version-to-version (surprising, should-be-embarrassing) software bugs.
I didn't say it was a bug, but an issue. Just something not supported in that version, and pretty easy to workaround. A micro-service would not have helped in my case due to project requirements, needing to work in iOS completely offline.
Understand about the iOS consideration if you have no WiFi or Internet connectivity.
Since, according to the OP, worked in one version, but displayed nothing in another version. To me, that's a bug since the correct answer is clearly displayed above.
As far as your "workaround", having to keep track of a previously-generated hash and (take on the added task to remember to) hard-code that hash should (again, IMHO) further embarrass FMI that developers have to resort to workarounds like that. It's OK to have bugs. All software does. But, please fix them.
(In my case, since I don't use FMP's functions for things like JSON, XML, most string parsing, list processing, most looping, date math, symmetric/asym crypto, hashing, as a few examples, these bugs don't affect me.)
Retrieving data ...