document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <html>
  2. <head>
  3. <title>Form serialize and sign with sha1/title>
  4. <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.custom.css" rel="stylesheet" /> 
  5. <link href="css/rgb.css" type="text/css" rel="stylesheet"/>
  6.  
  7. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
  8. <script type="text/javascript" src="http://oauth.googlecode.com/svn/code/javascript/sha1.js"></script>
  9.  
  10. <script type="text/javascript">
  11.         $(function() {
  12.  
  13.         str = $("form").serialize().split("&").sort().join("&");
  14.         hex_str = hex_sha1(str);
  15.         console.log(str + "&sig=" + hex_str);
  16.  
  17.         });
  18.  
  19. </script>
  20. </head>
  21. <body>
  22. <div class="testapp">
  23.  
  24. <p class="ui-state-default ui-corner-all ui-helper-clearfix" style="padding:4px;">
  25. <span class="ui-icon ui-icon-pencil" style="float:left; margin:-2px 5px 0 0;"></span>
  26. Form serialize and sign with sha1
  27. </p>
  28.  
  29. <div class="testapp-description" style="clear:left;">
  30.  
  31. <p>Collect form data and sign with sha1</p>
  32.  
  33. <form>
  34. <input id="f1" name="f1" value="1"> </input>
  35. <input id="f2" name="f2" value="2"> </input>
  36. <input id="f3" name="f3" value="3"> </input>
  37.  
  38.  
  39. </form>
  40.  
  41. </div>
  42. </body>
  43. </html>
');