José Antonio Rocha wrote:
2014-12-15 17:25 GMT-02:00 Richard Gaskin:
LiveCode currently provides only two hashes, MD5 and SHA1.  I have a
project in which I need SHA256.  Anyone here have a function for that?

Hi!
There is this, but I could not make it work:
http://masmit.net/libhash-hmac.html

Brilliant! Works great.

To make that lib work the only modification needed is to comment out the function definition for sha1digest, since that's now a built-in LiveCode function.

Using that lib I ran this:

     put sha256.hex("ambassa...@fourthworld.com")

...and verified it against OS X's implementation using a simple text file with the same string:

    shasum -a 256 ~/Desktop/addy.txt

Both returned:

    a14aa8957080619214e553cb552e7bf4bdbce216813d1bce2b50ea74a97a95e4

Another success story thanks to the late great Mark Smith. Thanks for turning me onto that library.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to