Tuesday, March 30, 2010

March Madness Challenge - Day 30

Example of a sha1 signed query string from a form. This is useful if you are calling a REST method from a web service. Next time I do this I'm going to look at the code posted here: http://code.google.com/p/crypto-js/

Here's the important part:

str = $("form").serialize().split("&").sort().join("&");
hex_str = hex_sha1(str);
console.log(str + "&sig=" + hex_str);


Full code:

No comments: