mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-22 04:42:10 +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/caesar_cipher.cpp File Reference</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');
|
||||
@@ -213,12 +213,11 @@ Algorithm</h3>
|
||||
<div class="line"><span class="lineno"> 86</span> <span class="keywordflow">if</span>(place_value < 0) { <span class="comment">// Handling case where remainder is negative </span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> place_value = place_value + 26;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">char</span> new_char = <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(place_value); <span class="comment">// Getting original character from decrypted value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordtype">char</span> new_char = get_char(place_value); <span class="comment">// Getting original character from decrypted value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 90</span> decrypted_text += new_char; <span class="comment">// Appending decrypted character</span></div>
|
||||
<div class="line"><span class="lineno"> 91</span> }</div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">return</span> decrypted_text; <span class="comment">// Returning decrypted text</span></div>
|
||||
<div class="line"><span class="lineno"> 93</span> }</div>
|
||||
<div class="ttc" id="asha256_8cpp_html_a9e98c180d32b04aab6f767cb0c13e1da"><div class="ttname"><a href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">hashing::sha256::get_char</a></div><div class="ttdeci">char get_char(const std::string &input, std::size_t pos)</div><div class="ttdoc">Returns the character at pos after the input is padded.</div><div class="ttdef"><b>Definition</b> <a href="../../d4/d08/sha256_8cpp_source.html#l00170">sha256.cpp:170</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -255,7 +254,7 @@ Algorithm</h3>
|
||||
<div class="line"><span class="lineno"> 67</span> <span class="keywordflow">for</span> (<span class="keywordtype">char</span> c : text) { <span class="comment">// Going through each character</span></div>
|
||||
<div class="line"><span class="lineno"> 68</span> <span class="keywordtype">int</span> place_value = get_value(c); <span class="comment">// Getting value of character (i.e. 0-25)</span></div>
|
||||
<div class="line"><span class="lineno"> 69</span> place_value = (place_value + shift) % 26; <span class="comment">// Applying encryption formula</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordtype">char</span> new_char = <a class="code hl_function" href="../../d4/d08/sha256_8cpp.html#a9e98c180d32b04aab6f767cb0c13e1da">get_char</a>(place_value); <span class="comment">// Getting new character from new value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordtype">char</span> new_char = get_char(place_value); <span class="comment">// Getting new character from new value (i.e. A-Z)</span></div>
|
||||
<div class="line"><span class="lineno"> 71</span> encrypted_text += new_char; <span class="comment">// Appending encrypted character</span></div>
|
||||
<div class="line"><span class="lineno"> 72</span> }</div>
|
||||
<div class="line"><span class="lineno"> 73</span> <span class="keywordflow">return</span> encrypted_text; <span class="comment">// Returning encrypted text</span></div>
|
||||
@@ -335,7 +334,7 @@ Algorithm</h3>
|
||||
<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="../../d6/d2c/caesar__cipher_8cpp.html">caesar_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