mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-21 12:23:13 +08:00
Documentation for c26eea874d
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: ciphers/atbash_cipher.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
@@ -60,7 +60,7 @@ window.MathJax = {
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
@@ -124,12 +124,12 @@ $(function(){initNavTree('dc/dfb/atbash__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="headertitle"><div class="title">atbash_cipher.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../dc/dfb/atbash__cipher_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<a href="../../dc/dfb/atbash__cipher_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <map></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <string></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span></div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d4e/namespaceciphers.html">ciphers</a> {</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../de/db3/namespaceatbash.html">atbash</a> {</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>std::map<char, char> atbash_cipher_map = {</div>
|
||||
@@ -144,7 +144,7 @@ $(function(){initNavTree('dc/dfb/atbash__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> {<span class="charliteral">'W'</span>, <span class="charliteral">'D'</span>}, {<span class="charliteral">'X'</span>, <span class="charliteral">'C'</span>}, {<span class="charliteral">'Y'</span>, <span class="charliteral">'B'</span>}, {<span class="charliteral">'Z'</span>, <span class="charliteral">'A'</span>}, {<span class="charliteral">' '</span>, <span class="charliteral">' '</span>}</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>};</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span></div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../dc/dfb/atbash__cipher_8cpp.html#a8f7dd4dcd3df7c512c20482afc2dbb9d"> 47</a></span>std::string <a class="code hl_function" href="../../dc/dfb/atbash__cipher_8cpp.html#a8f7dd4dcd3df7c512c20482afc2dbb9d">atbash_cipher</a>(<span class="keyword">const</span> std::string& text) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> std::string result;</div>
|
||||
@@ -157,14 +157,14 @@ $(function(){initNavTree('dc/dfb/atbash__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span>} <span class="comment">// namespace atbash</span></div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span>} <span class="comment">// namespace ciphers</span></div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span></div>
|
||||
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../dc/dfb/atbash__cipher_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 62</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/dfb/atbash__cipher_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// 1st test</span></div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> std::string text = <span class="stringliteral">"Hello World"</span>;</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> std::string expected = <span class="stringliteral">"Svool Dliow"</span>;</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::string encrypted_text = ciphers::atbash::atbash_cipher(text);</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::string decrypted_text = ciphers::atbash::atbash_cipher(encrypted_text);</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::string encrypted_text = <a class="code hl_function" href="../../dc/dfb/atbash__cipher_8cpp.html#a8f7dd4dcd3df7c512c20482afc2dbb9d">ciphers::atbash::atbash_cipher</a>(text);</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::string decrypted_text = <a class="code hl_function" href="../../dc/dfb/atbash__cipher_8cpp.html#a8f7dd4dcd3df7c512c20482afc2dbb9d">ciphers::atbash::atbash_cipher</a>(encrypted_text);</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> assert(expected == encrypted_text);</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> assert(text == decrypted_text);</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> std::cout << <span class="stringliteral">"Original text: "</span> << text << std::endl;</div>
|
||||
@@ -174,7 +174,7 @@ $(function(){initNavTree('dc/dfb/atbash__cipher_8cpp_source.html','../../'); ini
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> std::cout << <span class="stringliteral">"\nAll tests have successfully passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span></div>
|
||||
<div class="foldopen" id="foldopen00081" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="../../dc/dfb/atbash__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 81</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../dc/dfb/atbash__cipher_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <a class="code hl_function" href="../../dc/dfb/atbash__cipher_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
@@ -192,7 +192,7 @@ $(function(){initNavTree('dc/dfb/atbash__cipher_8cpp_source.html','../../'); ini
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_4d6e05837bf820fb089a8a8cdf2f42b7.html">ciphers</a></li><li class="navelem"><a class="el" href="../../dc/dfb/atbash__cipher_8cpp.html">atbash_cipher.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user