SHA-2 Support
Moderator: Klaus
-
- Posts: 5
- Joined: Mon Dec 08, 2008 1:00 am
SHA-2 Support
I have a project that I would like to use LiveCode, but need SHA-256 in order to interact with a REST API on a server. According to WikiPedia this algorithm is part of SHA-2 and I believe we only have SHA-1 with the current LiveCode release. I do not see where it would be feasible to try to depend on third-party software which would add unnecessary complexity/overhead or trying to cobble together something SDKs that are platform specific along with LiveCode.
Re: SHA-2 Support
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: SHA-2 Support
There are a few options. You can do what you want with PHP and you can call a PHP script with a URL in LiveCode. Another possibility is using views and triggers in the database. You could do a query on a view without affecting the database. The query would run a trigger, which could be a lengthy SQL script.
nice
Re: SHA-2 Support
... or go directly here and download the library : http://marksmith.on-rev.com/revstuff/Mark wrote: Look here http://qery.us/3ae and follow the link in that forum thread.

Guglielmo
Re: SHA-2 Support
Guglielmo, I wanted to make clear the OP could have searched the forum and would easily have found the link by himself.
Mark
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: SHA-2 Support
Searching here for both "sha2" and "sha-2" yields zero results for each.Mark wrote:Guglielmo, I wanted to make clear the OP could have searched the forum and would easily have found the link by himself.
I think there's something off about the search feature's indexing.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: SHA-2 Support
Hi,
"sha" returns some results. Don't give up too quickly.
Best,
Mark
"sha" returns some results. Don't give up too quickly.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: SHA-2 Support
True, it's possible to try various permutations until you find the right one, but since sha-1 is supported in the LiveCode language it seems reasonable that someone looking for something else would try a more specific search.Mark wrote:"sha" returns some results. Don't give up too quickly.
Indeed, of the 24 posts a search for "sha" yields, only one contains the link to Mark's stuff, and you'd almost have to know that's what you're looking for since the text surrounding it in the search results provides no clarity. Many of the rest only make reference to the existing sha-1 support.
While I'm glad to see the indexer here isn't as broken as others have described it, I also appreciate community members like Guglielmo willing to take a moment out to provide quick specific answers.
Thanks for that post, Guglielmo. Mark's repository is quite a valuable legacy.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: SHA-2 Support
You're welcome RichardFourthWorld wrote:...
Thanks for that post, Guglielmo. Mark's repository is quite a valuable legacy.

Guglielmo
Re: SHA-2 Support
Sure. I already know you like repetition. I did take the effort of finding that one post and linking to it and I think you could thank me instead of nagging me for it.
Mark
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: SHA-2 Support
OK - looks like I need to do this REST stuff as well - hope I'm not too late to the party. I downloaded Mark Smith's library and tried out the hmacsha256.hex function but it gives me different results to those provided by our web developer when I use the uri and private key he provided me with. Is there anything I need to do to the uri or the key before I pass it to the function?
Terry...
Terry...
Re: SHA-2 Support
Terry,
Can you show your script (without keys) and the output?
Mark
Can you show your script (without keys) and the output?
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: SHA-2 Support
Thanks for replying Mark but I had another crack at it this afternoon and it looks like we're all good now. It turns out there were some unexpected characters in the key string that was supplied to me. Once I identified those and stripped them out the two hashes matched. So I can REST easy now - ouch!
Regards,
Terry...
Regards,
Terry...