Files
rippled/md____w_rippled_rippled_include_xrpl_basics_README.html
2025-01-23 19:42:21 +00:00

124 lines
5.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<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.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>rippled: Basics</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">rippled
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
</div><!-- top -->
<div><div class="header">
<div class="headertitle"><div class="title">Basics </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p >Utility functions and classes.</p>
<p >ripple/basic should contain no dependencies on other modules.</p>
<h1><a class="anchor" id="autotoc_md186"></a>
Choosing a rippled container.</h1>
<ul>
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></code><ul>
<li>For ordered containers with most insertions or erases at the end.</li>
</ul>
</li>
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/deque.html">std::deque</a></code><ul>
<li>For ordered containers with most insertions or erases at the start or end.</li>
</ul>
</li>
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/list.html">std::list</a></code><ul>
<li>For ordered containers with inserts and erases to the middle.</li>
<li>For containers with iterators stable over insert and erase.</li>
<li>Generally slower and bigger than <code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></code> or <code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/deque.html">std::deque</a></code> except for those cases.</li>
</ul>
</li>
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/set.html">std::set</a></code><ul>
<li>For sorted containers.</li>
</ul>
</li>
<li><code><a class="el" href="namespaceripple.html#a7750eec5e079354285f1d60cfd0247ca">ripple::hash_set</a></code><ul>
<li>Where inserts and contains need to be O(1).</li>
<li>For "small" sets, <code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/set.html">std::set</a></code> might be faster and smaller.</li>
</ul>
</li>
<li><code><a class="el" href="namespaceripple.html#a3fd083ce42b38018aa59306a4660a52e">ripple::hardened_hash_set</a></code><ul>
<li>For data sets where the key could be manipulated by an attacker in an attempt to mount an algorithmic complexity attack: see <a href="http://en.wikipedia.org/wiki/Algorithmic_complexity_attack">http://en.wikipedia.org/wiki/Algorithmic_complexity_attack</a></li>
</ul>
</li>
</ul>
<p >The following container is deprecated</p>
<ul>
<li><code><a class="elRef" href="http://en.cppreference.com/w/cpp/container/unordered_set.html">std::unordered_set</a></code><ul>
<li>Use <code><a class="el" href="namespaceripple.html#a7750eec5e079354285f1d60cfd0247ca">ripple::hash_set</a></code> instead, which uses a better hashing algorithm.</li>
<li>Or use <code><a class="el" href="namespaceripple.html#a3fd083ce42b38018aa59306a4660a52e">ripple::hardened_hash_set</a></code> to prevent algorithmic complexity attacks. </li>
</ul>
</li>
</ul>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>