\hypertarget{group__sha}{}\section{S\+HA and B64 helpers} \label{group__sha}\index{S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}} \subsection*{Functions} \begin{DoxyCompactItemize} \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN unsigned char $\ast$ \hyperlink{group__sha_ga7b09ab74646266f0b555103b3bb8dfe5}{lws\+\_\+\+S\+H\+A1} (const unsigned char $\ast$d, size\+\_\+t n, unsigned char $\ast$md) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__sha_gaf39765e4a3b413efb65e4698b2ec3575}{lws\+\_\+b64\+\_\+encode\+\_\+string} (const char $\ast$in, int in\+\_\+len, char $\ast$out, int out\+\_\+size) \item L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__sha_ga66316e6a5a0644a09d5a10e919dfdd8d}{lws\+\_\+b64\+\_\+decode\+\_\+string} (const char $\ast$in, char $\ast$out, int out\+\_\+size) \end{DoxyCompactItemize} \subsection{Detailed Description} \subsubsection*{S\+HA and B64 helpers} These provide S\+H\+A-\/1 and B64 helper apis \subsection{Function Documentation} \index{S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}!lws\+\_\+b64\+\_\+decode\+\_\+string@{lws\+\_\+b64\+\_\+decode\+\_\+string}} \index{lws\+\_\+b64\+\_\+decode\+\_\+string@{lws\+\_\+b64\+\_\+decode\+\_\+string}!S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}} \subsubsection[{\texorpdfstring{lws\+\_\+b64\+\_\+decode\+\_\+string(const char $\ast$in, char $\ast$out, int out\+\_\+size)}{lws\_b64\_decode\_string(const char *in, char *out, int out\_size)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+b64\+\_\+decode\+\_\+string ( \begin{DoxyParamCaption} \item[{const char $\ast$}]{in, } \item[{char $\ast$}]{out, } \item[{int}]{out\+\_\+size} \end{DoxyParamCaption} )}\hypertarget{group__sha_ga66316e6a5a0644a09d5a10e919dfdd8d}{}\label{group__sha_ga66316e6a5a0644a09d5a10e919dfdd8d} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__sha_ga66316e6a5a0644a09d5a10e919dfdd8d}{lws\+\_\+b64\+\_\+decode\+\_\+string()}\+: decode a string from base 64 \begin{DoxyParams}{Parameters} {\em in} & incoming buffer \\ \hline {\em out} & result buffer \\ \hline {\em out\+\_\+size} & length of result buffer\\ \hline \end{DoxyParams} Decodes a string using b64 \index{S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}!lws\+\_\+b64\+\_\+encode\+\_\+string@{lws\+\_\+b64\+\_\+encode\+\_\+string}} \index{lws\+\_\+b64\+\_\+encode\+\_\+string@{lws\+\_\+b64\+\_\+encode\+\_\+string}!S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}} \subsubsection[{\texorpdfstring{lws\+\_\+b64\+\_\+encode\+\_\+string(const char $\ast$in, int in\+\_\+len, char $\ast$out, int out\+\_\+size)}{lws\_b64\_encode\_string(const char *in, int in\_len, char *out, int out\_size)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+b64\+\_\+encode\+\_\+string ( \begin{DoxyParamCaption} \item[{const char $\ast$}]{in, } \item[{int}]{in\+\_\+len, } \item[{char $\ast$}]{out, } \item[{int}]{out\+\_\+size} \end{DoxyParamCaption} )}\hypertarget{group__sha_gaf39765e4a3b413efb65e4698b2ec3575}{}\label{group__sha_gaf39765e4a3b413efb65e4698b2ec3575} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__sha_gaf39765e4a3b413efb65e4698b2ec3575}{lws\+\_\+b64\+\_\+encode\+\_\+string()}\+: encode a string into base 64 \begin{DoxyParams}{Parameters} {\em in} & incoming buffer \\ \hline {\em in\+\_\+len} & length of incoming buffer \\ \hline {\em out} & result buffer \\ \hline {\em out\+\_\+size} & length of result buffer\\ \hline \end{DoxyParams} Encodes a string using b64 \index{S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}!lws\+\_\+\+S\+H\+A1@{lws\+\_\+\+S\+H\+A1}} \index{lws\+\_\+\+S\+H\+A1@{lws\+\_\+\+S\+H\+A1}!S\+H\+A and B64 helpers@{S\+H\+A and B64 helpers}} \subsubsection[{\texorpdfstring{lws\+\_\+\+S\+H\+A1(const unsigned char $\ast$d, size\+\_\+t n, unsigned char $\ast$md)}{lws\_SHA1(const unsigned char *d, size\_t n, unsigned char *md)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN unsigned char$\ast$ lws\+\_\+\+S\+H\+A1 ( \begin{DoxyParamCaption} \item[{const unsigned char $\ast$}]{d, } \item[{size\+\_\+t}]{n, } \item[{unsigned char $\ast$}]{md} \end{DoxyParamCaption} )}\hypertarget{group__sha_ga7b09ab74646266f0b555103b3bb8dfe5}{}\label{group__sha_ga7b09ab74646266f0b555103b3bb8dfe5} {\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$} \hyperlink{group__sha_ga7b09ab74646266f0b555103b3bb8dfe5}{lws\+\_\+\+S\+H\+A1()}\+: make a S\+H\+A-\/1 digest of a buffer \begin{DoxyParams}{Parameters} {\em d} & incoming buffer \\ \hline {\em n} & length of incoming buffer \\ \hline {\em md} & buffer for message digest (must be $>$= 20 bytes)\\ \hline \end{DoxyParams} Reduces any size buffer into a 20-\/byte S\+H\+A-\/1 hash.