group__sha.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.11"/>
  7. <title>libwebsockets: SHA and B64 helpers</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="resize.js"></script>
  13. <script type="text/javascript" src="navtreedata.js"></script>
  14. <script type="text/javascript" src="navtree.js"></script>
  15. <script type="text/javascript">
  16. $(document).ready(initResizable);
  17. $(window).load(resizeHeight);
  18. </script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
  28. <td id="projectalign" style="padding-left: 0.5em;">
  29. <div id="projectname">libwebsockets
  30. </div>
  31. <div id="projectbrief">Lightweight C library for HTML5 websockets</div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.8.11 -->
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  43. <li class="current"><a href="modules.html"><span>Modules</span></a></li>
  44. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  45. <li><a href="files.html"><span>Files</span></a></li>
  46. </ul>
  47. </div>
  48. </div><!-- top -->
  49. <div id="side-nav" class="ui-resizable side-nav-resizable">
  50. <div id="nav-tree">
  51. <div id="nav-tree-contents">
  52. <div id="nav-sync" class="sync"></div>
  53. </div>
  54. </div>
  55. <div id="splitbar" style="-moz-user-select:none;"
  56. class="ui-resizable-handle">
  57. </div>
  58. </div>
  59. <script type="text/javascript">
  60. $(document).ready(function(){initNavTree('group__sha.html','');});
  61. </script>
  62. <div id="doc-content">
  63. <div class="header">
  64. <div class="summary">
  65. <a href="#func-members">Functions</a> </div>
  66. <div class="headertitle">
  67. <div class="title">SHA and B64 helpers</div> </div>
  68. </div><!--header-->
  69. <div class="contents">
  70. <table class="memberdecls">
  71. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  72. Functions</h2></td></tr>
  73. <tr class="memitem:ga7b09ab74646266f0b555103b3bb8dfe5"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN unsigned char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sha.html#ga7b09ab74646266f0b555103b3bb8dfe5">lws_SHA1</a> (const unsigned char *d, size_t n, unsigned char *md)</td></tr>
  74. <tr class="separator:ga7b09ab74646266f0b555103b3bb8dfe5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. <tr class="memitem:gaf39765e4a3b413efb65e4698b2ec3575"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sha.html#gaf39765e4a3b413efb65e4698b2ec3575">lws_b64_encode_string</a> (const char *in, int in_len, char *out, int out_size)</td></tr>
  76. <tr class="separator:gaf39765e4a3b413efb65e4698b2ec3575"><td class="memSeparator" colspan="2">&#160;</td></tr>
  77. <tr class="memitem:ga66316e6a5a0644a09d5a10e919dfdd8d"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sha.html#ga66316e6a5a0644a09d5a10e919dfdd8d">lws_b64_decode_string</a> (const char *in, char *out, int out_size)</td></tr>
  78. <tr class="separator:ga66316e6a5a0644a09d5a10e919dfdd8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  79. </table>
  80. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  81. <h2>SHA and B64 helpers</h2>
  82. <p>These provide SHA-1 and B64 helper apis </p>
  83. <h2 class="groupheader">Function Documentation</h2>
  84. <a class="anchor" id="ga66316e6a5a0644a09d5a10e919dfdd8d"></a>
  85. <div class="memitem">
  86. <div class="memproto">
  87. <table class="memname">
  88. <tr>
  89. <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_b64_decode_string </td>
  90. <td>(</td>
  91. <td class="paramtype">const char *&#160;</td>
  92. <td class="paramname"><em>in</em>, </td>
  93. </tr>
  94. <tr>
  95. <td class="paramkey"></td>
  96. <td></td>
  97. <td class="paramtype">char *&#160;</td>
  98. <td class="paramname"><em>out</em>, </td>
  99. </tr>
  100. <tr>
  101. <td class="paramkey"></td>
  102. <td></td>
  103. <td class="paramtype">int&#160;</td>
  104. <td class="paramname"><em>out_size</em>&#160;</td>
  105. </tr>
  106. <tr>
  107. <td></td>
  108. <td>)</td>
  109. <td></td><td></td>
  110. </tr>
  111. </table>
  112. </div><div class="memdoc">
  113. <p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
  114. <p><a class="el" href="group__sha.html#ga66316e6a5a0644a09d5a10e919dfdd8d">lws_b64_decode_string()</a>: decode a string from base 64</p>
  115. <dl class="params"><dt>Parameters</dt><dd>
  116. <table class="params">
  117. <tr><td class="paramname">in</td><td>incoming buffer </td></tr>
  118. <tr><td class="paramname">out</td><td>result buffer </td></tr>
  119. <tr><td class="paramname">out_size</td><td>length of result buffer</td></tr>
  120. </table>
  121. </dd>
  122. </dl>
  123. <p>Decodes a string using b64 </p>
  124. </div>
  125. </div>
  126. <a class="anchor" id="gaf39765e4a3b413efb65e4698b2ec3575"></a>
  127. <div class="memitem">
  128. <div class="memproto">
  129. <table class="memname">
  130. <tr>
  131. <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_b64_encode_string </td>
  132. <td>(</td>
  133. <td class="paramtype">const char *&#160;</td>
  134. <td class="paramname"><em>in</em>, </td>
  135. </tr>
  136. <tr>
  137. <td class="paramkey"></td>
  138. <td></td>
  139. <td class="paramtype">int&#160;</td>
  140. <td class="paramname"><em>in_len</em>, </td>
  141. </tr>
  142. <tr>
  143. <td class="paramkey"></td>
  144. <td></td>
  145. <td class="paramtype">char *&#160;</td>
  146. <td class="paramname"><em>out</em>, </td>
  147. </tr>
  148. <tr>
  149. <td class="paramkey"></td>
  150. <td></td>
  151. <td class="paramtype">int&#160;</td>
  152. <td class="paramname"><em>out_size</em>&#160;</td>
  153. </tr>
  154. <tr>
  155. <td></td>
  156. <td>)</td>
  157. <td></td><td></td>
  158. </tr>
  159. </table>
  160. </div><div class="memdoc">
  161. <p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
  162. <p><a class="el" href="group__sha.html#gaf39765e4a3b413efb65e4698b2ec3575">lws_b64_encode_string()</a>: encode a string into base 64</p>
  163. <dl class="params"><dt>Parameters</dt><dd>
  164. <table class="params">
  165. <tr><td class="paramname">in</td><td>incoming buffer </td></tr>
  166. <tr><td class="paramname">in_len</td><td>length of incoming buffer </td></tr>
  167. <tr><td class="paramname">out</td><td>result buffer </td></tr>
  168. <tr><td class="paramname">out_size</td><td>length of result buffer</td></tr>
  169. </table>
  170. </dd>
  171. </dl>
  172. <p>Encodes a string using b64 </p>
  173. </div>
  174. </div>
  175. <a class="anchor" id="ga7b09ab74646266f0b555103b3bb8dfe5"></a>
  176. <div class="memitem">
  177. <div class="memproto">
  178. <table class="memname">
  179. <tr>
  180. <td class="memname">LWS_VISIBLE LWS_EXTERN unsigned char* lws_SHA1 </td>
  181. <td>(</td>
  182. <td class="paramtype">const unsigned char *&#160;</td>
  183. <td class="paramname"><em>d</em>, </td>
  184. </tr>
  185. <tr>
  186. <td class="paramkey"></td>
  187. <td></td>
  188. <td class="paramtype">size_t&#160;</td>
  189. <td class="paramname"><em>n</em>, </td>
  190. </tr>
  191. <tr>
  192. <td class="paramkey"></td>
  193. <td></td>
  194. <td class="paramtype">unsigned char *&#160;</td>
  195. <td class="paramname"><em>md</em>&#160;</td>
  196. </tr>
  197. <tr>
  198. <td></td>
  199. <td>)</td>
  200. <td></td><td></td>
  201. </tr>
  202. </table>
  203. </div><div class="memdoc">
  204. <p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
  205. <p><a class="el" href="group__sha.html#ga7b09ab74646266f0b555103b3bb8dfe5">lws_SHA1()</a>: make a SHA-1 digest of a buffer</p>
  206. <dl class="params"><dt>Parameters</dt><dd>
  207. <table class="params">
  208. <tr><td class="paramname">d</td><td>incoming buffer </td></tr>
  209. <tr><td class="paramname">n</td><td>length of incoming buffer </td></tr>
  210. <tr><td class="paramname">md</td><td>buffer for message digest (must be &gt;= 20 bytes)</td></tr>
  211. </table>
  212. </dd>
  213. </dl>
  214. <p>Reduces any size buffer into a 20-byte SHA-1 hash. </p>
  215. </div>
  216. </div>
  217. </div><!-- contents -->
  218. </div><!-- doc-content -->
  219. <!-- start footer part -->
  220. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  221. <ul>
  222. <li class="footer">Generated by
  223. <a href="http://www.doxygen.org/index.html">
  224. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  225. </ul>
  226. </div>
  227. </body>
  228. </html>