⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classalgorithm.html

📁 LINUX下发送邮件的库,测试很好用,有各种发送测试的例子
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Algorithm class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>Algorithm  Class Reference</h1><code>#include &lt;<a class="el" href="algorithm_8h-source.html">algorithm.h</a>&gt;</code>
<p>
<a href="classAlgorithm-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td nowrap align=right valign=top>enum &nbsp;</td><td valign=bottom><b>CODEC</b> { <b>BASE64</b>, 
<b>BASE64_NIL</b>
 }</td></tr>
<tr><td colspan=2><br><h2>Static Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>string&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#d0">encode</a> (const string &amp;str, CODEC codec)</td></tr>
<tr><td nowrap align=right valign=top>string&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#d1">decode</a> (const string &amp;str, CODEC codec)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#d2">hmac_md5</a> (const string &amp;text, const string &amp;key, unsigned char *digest)</td></tr>
<tr><td nowrap align=right valign=top>string&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#d3">hmac_md5_str</a> (const string &amp;str, const string &amp;key)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#d4">hmac_sha1</a> (const string &amp;text, const string &amp;key, unsigned char *digest)</td></tr>
<tr><td nowrap align=right valign=top>string&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#d5">hmac_sha1_str</a> (const string &amp;str, const string &amp;key)</td></tr>
<tr><td colspan=2><br><h2>Static Protected Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#e0">enc_base64</a> (const string &amp;orig_str, string *enc_str)</td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#e1">dec_base64</a> (const string &amp;enc_str, string *orig_str)</td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#e2">dec_base64_nil</a> (const string &amp;enc_str, string *orig_str)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#e3">enc_base64_nil</a> (string orig_str, string *enc_str)</td></tr>
<tr><td colspan=2><br><h2>Static Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top>char&nbsp;</td><td valign=bottom><a class="el" href="classAlgorithm.html#q0">tbl_base64</a> [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class provides some convenient methods for the following algorithms: BASE64, BASE64_NIL, hmac_md5 and hmac_sha1.
<p>
<dl compact><dt><b>
Author: </b><dd>
Timo Benk &lt;<a href="mailto:t_benk@web.de">t_benk@web.de</a>&gt; </dl>
<p>
<hr><h2>Member Function Documentation</h2>
<a name="e1" doxytag="Algorithm::dec_base64"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int Algorithm::dec_base64 </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const string &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>enc_str</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>string *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>orig_str</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Decode enc_str with the base64 codec and store the result in the string pointed by orig_str. If successfull 0 is returned, and -1 if the base64 data was invalid.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>enc_str</em>&nbsp;</td><td>
The string that should be decoded. </td></tr>
<tr><td valign=top><em>orig_str</em>&nbsp;</td><td>
The resulting decoded string will be stored at the address pointed to by orig_str. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
0 if the decoding process was successfull and -1 if the base64 data was invalid. </dl>    </td>
  </tr>
</table>
<a name="e2" doxytag="Algorithm::dec_base64_nil"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int Algorithm::dec_base64_nil </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const string &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>enc_str</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>string *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>orig_str</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Decode enc_str with a slightly advanced base64  codec and store the result in the string pointed  by orig_str. Each zero byte will be substituted with the sequence "&lt;NIL&gt;". If successfull 0 is returned, and -1 if the base64 data was invalid.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>enc_str</em>&nbsp;</td><td>
The string that should be decoded. </td></tr>
<tr><td valign=top><em>orig_str</em>&nbsp;</td><td>
The resulting decoded string will be stored at the address pointed to by orig_str. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
0 if the decodeing process was successfull and -1 if the base64 data was invalid. </dl>    </td>
  </tr>
</table>
<a name="d1" doxytag="Algorithm::decode"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> string Algorithm::decode </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const string &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>str</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>CODEC&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>codec</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Decode str with the given codec.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>str</em>&nbsp;</td><td>
The string that should be decoded. </td></tr>
<tr><td valign=top><em>codec</em>&nbsp;</td><td>
The codec that should be used. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
The encoded string.</dl><dl compact><dt><b>
Exceptions: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="el" href="classDecodeException.html">DecodeException</a></em>&nbsp;</td><td>
 If the BASE64 data was invalid. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="e0" doxytag="Algorithm::enc_base64"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Algorithm::enc_base64 </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const string &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>orig_str</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>string *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>enc_str</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Encode orig_str with the base64 codec and store the result in the string pointed by enc_str.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>orig_str</em>&nbsp;</td><td>
The string that should be encoded. </td></tr>
<tr><td valign=top><em>enc_str</em>&nbsp;</td><td>
The resulting encoded string will be stored at the address pointed to by enc_str. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="e3" doxytag="Algorithm::enc_base64_nil"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Algorithm::enc_base64_nil </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">string&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>orig_str</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>string *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>enc_str</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Encode enc_str with a slightly advanced base64 codec  and store the result in the string pointed by orig_str. The sequence "&lt;NIL&gt;" will be substituted with one zero byte.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>orig_str</em>&nbsp;</td><td>
The string that should be encoded. </td></tr>
<tr><td valign=top><em>enc_str</em>&nbsp;</td><td>
The resulting encoded string will be stored at the address pointed to by enc_str. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="d0" doxytag="Algorithm::encode"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -