oxipng/doc/bitflags/__core/hash/struct.SipHasher.html
2016-04-20 15:59:23 -04:00

149 lines
No EOL
13 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `SipHasher` struct in crate `bitflags`.">
<meta name="keywords" content="rust, rustlang, rust-lang, SipHasher">
<title>bitflags::__core::hash::SipHasher - Rust</title>
<link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../../main.css">
</head>
<body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='../../index.html'>bitflags</a>::<wbr><a href='../index.html'>__core</a>::<wbr><a href='index.html'>hash</a></p><script>window.sidebarCurrent = {name: 'SipHasher', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content struct">
<h1 class='fqn'><span class='in-band'>Struct <a href='../../index.html'>bitflags</a>::<wbr><a href='../index.html'>__core</a>::<wbr><a href='index.html'>hash</a>::<wbr><a class='struct' href=''>SipHasher</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a id='src-33923' class='srclink' href='https://doc.rust-lang.org/nightly/core/hash/sip/struct.SipHasher.html?gotosrc=33923' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct SipHasher {
// some fields omitted
}</pre><span class="since">1.0.0</span><div class='docblock'><p>An implementation of SipHash 2-4.</p>
<p>See: <a href="https://131002.net/siphash/">https://131002.net/siphash/</a></p>
<p>This is currently the default hashing function used by standard library
(eg. <code>collections::HashMap</code> uses it by default).</p>
<p>SipHash is a general-purpose hashing function: it runs at a good
speed (competitive with Spooky and City) and permits strong <em>keyed</em>
hashing. This lets you key your hashtables from a strong RNG, such as
<a href="https://doc.rust-lang.org/rand/rand/os/struct.OsRng.html"><code>rand::os::OsRng</code></a>.</p>
<p>Although the SipHash algorithm is considered to be generally strong,
it is not intended for cryptographic purposes. As such, all
cryptographic uses of this implementation are <em>strongly discouraged</em>.</p>
</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h3><div class='impl-items'><h4 id='method.new' class='method'><code>fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h4>
<div class='docblock'><p>Creates a new <code>SipHasher</code> with the two initial keys set to 0.</p>
</div><h4 id='method.new_with_keys' class='method'><code>fn <a href='#method.new_with_keys' class='fnname'>new_with_keys</a>(key0: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u64.html'>u64</a>, key1: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u64.html'>u64</a>) -&gt; <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h4>
<div class='docblock'><p>Creates a <code>SipHasher</code> that is keyed off the provided keys.</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/default/trait.Default.html' title='bitflags::__core::default::Default'>Default</a> for <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h3><div class='impl-items'><h4 id='method.default' class='method'><code>fn <a href='../../../bitflags/__core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/clone/trait.Clone.html' title='bitflags::__core::clone::Clone'>Clone</a> for <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='../../../bitflags/__core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h4>
<h4 id='method.clone_from' class='method'><code>fn <a href='../../../bitflags/__core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code></h4>
</div><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/hash/trait.Hasher.html' title='bitflags::__core::hash::Hasher'>Hasher</a> for <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h3><div class='impl-items'><h4 id='method.write' class='method'><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#tymethod.write' class='fnname'>write</a>(&amp;mut self, msg: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>&amp;[</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a><a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.slice.html'>]</a>)</code></h4>
<h4 id='method.finish' class='method'><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#tymethod.finish' class='fnname'>finish</a>(&amp;self) -&gt; <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u64.html'>u64</a></code></h4>
<h4 id='method.write_u8' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_u8' class='fnname'>write_u8</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u8.html'>u8</a>)</code></h4>
<h4 id='method.write_u16' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_u16' class='fnname'>write_u16</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u16.html'>u16</a>)</code></h4>
<h4 id='method.write_u32' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_u32' class='fnname'>write_u32</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u32.html'>u32</a>)</code></h4>
<h4 id='method.write_u64' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_u64' class='fnname'>write_u64</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.u64.html'>u64</a>)</code></h4>
<h4 id='method.write_usize' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_usize' class='fnname'>write_usize</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.usize.html'>usize</a>)</code></h4>
<h4 id='method.write_i8' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_i8' class='fnname'>write_i8</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i8.html'>i8</a>)</code></h4>
<h4 id='method.write_i16' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_i16' class='fnname'>write_i16</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i16.html'>i16</a>)</code></h4>
<h4 id='method.write_i32' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_i32' class='fnname'>write_i32</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i32.html'>i32</a>)</code></h4>
<h4 id='method.write_i64' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_i64' class='fnname'>write_i64</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.i64.html'>i64</a>)</code></h4>
<h4 id='method.write_isize' class='method'><span class="since">1.3.0</span><code>fn <a href='../../../bitflags/__core/hash/trait.Hasher.html#method.write_isize' class='fnname'>write_isize</a>(&amp;mut self, i: <a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.isize.html'>isize</a>)</code></h4>
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='../../../bitflags/__core/fmt/trait.Debug.html' title='bitflags::__core::fmt::Debug'>Debug</a> for <a class='struct' href='../../../bitflags/__core/hash/struct.SipHasher.html' title='bitflags::__core::hash::SipHasher'>SipHasher</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='../../../bitflags/__core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class='struct' href='../../../bitflags/__core/fmt/struct.Formatter.html' title='bitflags::__core::fmt::Formatter'>Formatter</a>) -&gt; <a class='enum' href='../../../bitflags/__core/result/enum.Result.html' title='bitflags::__core::result::Result'>Result</a>&lt;<a class='primitive' href='https://doc.rust-lang.org/nightly/bitflags/primitive.tuple.html'>()</a>, <a class='struct' href='../../../bitflags/__core/fmt/struct.Error.html' title='bitflags::__core::fmt::Error'>Error</a>&gt;</code></h4>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../../";
window.currentCrate = "bitflags";
window.playgroundUrl = "";
</script>
<script src="../../../jquery.js"></script>
<script src="../../../main.js"></script>
<script defer src="../../../search-index.js"></script>
</body>
</html>