summaryrefslogtreecommitdiffstats
path: root/OpenSSL/Digest.html
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2020-05-13 15:15:59 +0900
committerKazuki Yamaguchi <k@rhe.jp>2020-05-13 15:15:59 +0900
commitad2abc0cd93977a35565178a3b4b4e50edbd8f0b (patch)
tree5ed742c100ca8f3e0dbce3026e267c8a8077374b /OpenSSL/Digest.html
parente4fa205267b5943b72ee10b837e29e7fd9004272 (diff)
downloadruby-openssl-ad2abc0cd93977a35565178a3b4b4e50edbd8f0b.tar.gz
Sync with v2.2.0
Diffstat (limited to 'OpenSSL/Digest.html')
-rw-r--r--OpenSSL/Digest.html193
1 files changed, 39 insertions, 154 deletions
diff --git a/OpenSSL/Digest.html b/OpenSSL/Digest.html
index cae3957d..fa24f394 100644
--- a/OpenSSL/Digest.html
+++ b/OpenSSL/Digest.html
@@ -11,8 +11,11 @@
var index_rel_prefix = "../";
</script>
-<script src="../js/jquery.js"></script>
-<script src="../js/darkfish.js"></script>
+<script src="../js/navigation.js" defer></script>
+<script src="../js/search.js" defer></script>
+<script src="../js/search_index.js" defer></script>
+<script src="../js/searcher.js" defer></script>
+<script src="../js/darkfish.js" defer></script>
<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">
@@ -57,16 +60,6 @@
<h3>Table of Contents</h3>
<ul class="link-list" role="directory">
- <li><a href="#class-OpenSSL::Digest-label-Mapping+between+Digest+class+and+sn-2Fln">Mapping between Digest class and sn/ln</a>
- <li><a href="#class-OpenSSL::Digest-label-MD2">MD2</a>
- <li><a href="#class-OpenSSL::Digest-label-MD4">MD4</a>
- <li><a href="#class-OpenSSL::Digest-label-MD5">MD5</a>
- <li><a href="#class-OpenSSL::Digest-label-SHA">SHA</a>
- <li><a href="#class-OpenSSL::Digest-label-SHA-1">SHA-1</a>
- <li><a href="#class-OpenSSL::Digest-label-SHA-224">SHA-224</a>
- <li><a href="#class-OpenSSL::Digest-label-SHA-256">SHA-256</a>
- <li><a href="#class-OpenSSL::Digest-label-SHA-384">SHA-384</a>
- <li><a href="#class-OpenSSL::Digest-label-SHA-512">SHA-512</a>
<li><a href="#class-OpenSSL::Digest-label-Hashing+a+file">Hashing a file</a>
<li><a href="#class-OpenSSL::Digest-label-Hashing+several+pieces+of+data+at+once">Hashing several pieces of data at once</a>
<li><a href="#class-OpenSSL::Digest-label-Reuse+a+Digest+instance">Reuse a Digest instance</a>
@@ -123,133 +116,39 @@
<section class="description">
-<p><a href="Digest.html">OpenSSL::Digest</a> allows you to compute message
-digests (sometimes interchangeably called “hashes”) of arbitrary data that
-are cryptographically secure, i.e. a <a href="Digest.html">Digest</a>
-implements a secure one-way function.</p>
-
-<p>One-way functions offer some useful properties. E.g. given two distinct
-inputs the probability that both yield the same output is highly unlikely.
-Combined with the fact that every message digest algorithm has a
-fixed-length output of just a few bytes, digests are often used to create
-unique identifiers for arbitrary data. A common example is the creation of
-a unique id for binary documents that are stored in a database.</p>
-
-<p>Another useful characteristic of one-way functions (and thus the name) is
-that given a digest there is no indication about the original data that
-produced it, i.e. the only way to identify the original input is to
-“brute-force” through every possible combination of inputs.</p>
-
-<p>These characteristics make one-way functions also ideal companions for
-public key signature algorithms: instead of signing an entire document,
-first a hash of the document is produced with a considerably faster message
-digest algorithm and only the few bytes of its output need to be signed
-using the slower public key algorithm. To validate the integrity of a
-signed document, it suffices to re-compute the hash and verify that it is
-equal to that in the signature.</p>
-
-<p>Among the supported message digest algorithms are:</p>
-<ul><li>
-<p>SHA, SHA1, SHA224, SHA256, SHA384 and SHA512</p>
-</li><li>
-<p>MD2, MD4, MDC2 and MD5</p>
-</li><li>
-<p>RIPEMD160</p>
-</li><li>
-<p>DSS, DSS1 (Pseudo algorithms to be used for DSA signatures. DSS is equal to
-SHA and DSS1 is equal to SHA1)</p>
-</li></ul>
-
-<p>For each of these algorithms, there is a sub-class of <a
-href="Digest.html">Digest</a> that can be instantiated as simply as e.g.</p>
-
-<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>
-</pre>
-
-<h3 id="class-OpenSSL::Digest-label-Mapping+between+Digest+class+and+sn-2Fln">Mapping between <a href="Digest.html">Digest</a> class and sn/ln<span><a href="#class-OpenSSL::Digest-label-Mapping+between+Digest+class+and+sn-2Fln">&para;</a> <a href="#top">&uarr;</a></span></h3>
+<p><a href="Digest.html"><code>OpenSSL::Digest</code></a> allows you to compute message digests (sometimes interchangeably called “hashes”) of arbitrary data that are cryptographically secure, i.e. a <a href="Digest.html"><code>Digest</code></a> implements a secure one-way function.</p>
-<p>The sn (short names) and ln (long names) are defined in
-&lt;openssl/object.h&gt; and &lt;openssl/obj_mac.h&gt;. They are textual
-representations of ASN.1 OBJECT IDENTIFIERs. Each supported digest
-algorithm has an OBJECT IDENTIFIER associated to it and those again have
-short/long names assigned to them. E.g. the OBJECT IDENTIFIER for SHA-1 is
-1.3.14.3.2.26 and its sn is “SHA1” and its ln is “sha1”.</p>
+<p>One-way functions offer some useful properties. E.g. given two distinct inputs the probability that both yield the same output is highly unlikely. Combined with the fact that every message digest algorithm has a fixed-length output of just a few bytes, digests are often used to create unique identifiers for arbitrary data. A common example is the creation of a unique id for binary documents that are stored in a database.</p>
-<h4 id="class-OpenSSL::Digest-label-MD2">MD2<span><a href="#class-OpenSSL::Digest-label-MD2">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: MD2</p>
-</li><li>
-<p>ln: md2</p>
-</li></ul>
+<p>Another useful characteristic of one-way functions (and thus the name) is that given a digest there is no indication about the original data that produced it, i.e. the only way to identify the original input is to “brute-force” through every possible combination of inputs.</p>
-<h4 id="class-OpenSSL::Digest-label-MD4">MD4<span><a href="#class-OpenSSL::Digest-label-MD4">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: MD4</p>
-</li><li>
-<p>ln: md4</p>
-</li></ul>
-
-<h4 id="class-OpenSSL::Digest-label-MD5">MD5<span><a href="#class-OpenSSL::Digest-label-MD5">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: MD5</p>
-</li><li>
-<p>ln: md5</p>
-</li></ul>
+<p>These characteristics make one-way functions also ideal companions for public key signature algorithms: instead of signing an entire document, first a hash of the document is produced with a considerably faster message digest algorithm and only the few bytes of its output need to be signed using the slower public key algorithm. To validate the integrity of a signed document, it suffices to re-compute the hash and verify that it is equal to that in the signature.</p>
-<h4 id="class-OpenSSL::Digest-label-SHA">SHA<span><a href="#class-OpenSSL::Digest-label-SHA">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: SHA</p>
-</li><li>
-<p>ln: SHA</p>
-</li></ul>
+<p>You can get a list of all digest algorithms supported on your system by running this command in your terminal:</p>
-<h4 id="class-OpenSSL::Digest-label-SHA-1">SHA-1<span><a href="#class-OpenSSL::Digest-label-SHA-1">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: SHA1</p>
-</li><li>
-<p>ln: sha1</p>
-</li></ul>
+<pre class="ruby"><span class="ruby-identifier">openssl</span> <span class="ruby-identifier">list</span> <span class="ruby-operator">-</span><span class="ruby-identifier">digest</span><span class="ruby-operator">-</span><span class="ruby-identifier">algorithms</span>
+</pre>
-<h4 id="class-OpenSSL::Digest-label-SHA-224">SHA-224<span><a href="#class-OpenSSL::Digest-label-SHA-224">&para;</a> <a href="#top">&uarr;</a></span></h4>
+<p>Among the <a href="../OpenSSL.html"><code>OpenSSL</code></a> 1.1.1 supported message digest algorithms are:</p>
<ul><li>
-<p>sn: SHA224</p>
+<p>SHA224, SHA256, SHA384, SHA512, SHA512-224 and SHA512-256</p>
</li><li>
-<p>ln: sha224</p>
-</li></ul>
-
-<h4 id="class-OpenSSL::Digest-label-SHA-256">SHA-256<span><a href="#class-OpenSSL::Digest-label-SHA-256">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: SHA256</p>
+<p>SHA3-224, SHA3-256, SHA3-384 and SHA3-512</p>
</li><li>
-<p>ln: sha256</p>
+<p>BLAKE2s256 and BLAKE2b512</p>
</li></ul>
-<h4 id="class-OpenSSL::Digest-label-SHA-384">SHA-384<span><a href="#class-OpenSSL::Digest-label-SHA-384">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: SHA384</p>
-</li><li>
-<p>ln: sha384</p>
-</li></ul>
+<p>Each of these algorithms can be instantiated using the name:</p>
-<h4 id="class-OpenSSL::Digest-label-SHA-512">SHA-512<span><a href="#class-OpenSSL::Digest-label-SHA-512">&para;</a> <a href="#top">&uarr;</a></span></h4>
-<ul><li>
-<p>sn: SHA512</p>
-</li><li>
-<p>ln: sha512</p>
-</li></ul>
+<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA256&#39;</span>)
+</pre>
-<p>“Breaking” a message digest algorithm means defying its one-way function
-characteristics, i.e. producing a collision or finding a way to get to the
-original data by means that are more efficient than brute-forcing etc. Most
-of the supported digest algorithms can be considered broken in this sense,
-even the very popular MD5 and SHA1 algorithms. Should security be your
-highest concern, then you should probably rely on SHA224, SHA256, SHA384 or
-SHA512.</p>
+<p>“Breaking” a message digest algorithm means defying its one-way function characteristics, i.e. producing a collision or finding a way to get to the original data by means that are more efficient than brute-forcing etc. Most of the supported digest algorithms can be considered broken in this sense, even the very popular MD5 and SHA1 algorithms. Should security be your highest concern, then you should probably rely on SHA224, SHA256, SHA384 or SHA512.</p>
<h3 id="class-OpenSSL::Digest-label-Hashing+a+file">Hashing a file<span><a href="#class-OpenSSL::Digest-label-Hashing+a+file">&para;</a> <a href="#top">&uarr;</a></span></h3>
<pre class="ruby"><span class="ruby-identifier">data</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&#39;document&#39;</span>)
-<span class="ruby-identifier">sha256</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA256</span>.<span class="ruby-identifier">new</span>
+<span class="ruby-identifier">sha256</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA256&#39;</span>)
<span class="ruby-identifier">digest</span> = <span class="ruby-identifier">sha256</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-identifier">data</span>)
</pre>
@@ -258,17 +157,17 @@ SHA512.</p>
<pre class="ruby"><span class="ruby-identifier">data1</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&#39;file1&#39;</span>)
<span class="ruby-identifier">data2</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&#39;file2&#39;</span>)
<span class="ruby-identifier">data3</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&#39;file3&#39;</span>)
-<span class="ruby-identifier">sha256</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA256</span>.<span class="ruby-identifier">new</span>
+<span class="ruby-identifier">sha256</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA256&#39;</span>)
<span class="ruby-identifier">sha256</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data1</span>
<span class="ruby-identifier">sha256</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data2</span>
<span class="ruby-identifier">sha256</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data3</span>
<span class="ruby-identifier">digest</span> = <span class="ruby-identifier">sha256</span>.<span class="ruby-identifier">digest</span>
</pre>
-<h3 id="class-OpenSSL::Digest-label-Reuse+a+Digest+instance">Reuse a <a href="Digest.html">Digest</a> instance<span><a href="#class-OpenSSL::Digest-label-Reuse+a+Digest+instance">&para;</a> <a href="#top">&uarr;</a></span></h3>
+<h3 id="class-OpenSSL::Digest-label-Reuse+a+Digest+instance">Reuse a <a href="Digest.html"><code>Digest</code></a> instance<span><a href="#class-OpenSSL::Digest-label-Reuse+a+Digest+instance">&para;</a> <a href="#top">&uarr;</a></span></h3>
<pre class="ruby"><span class="ruby-identifier">data1</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&#39;file1&#39;</span>)
-<span class="ruby-identifier">sha256</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA256</span>.<span class="ruby-identifier">new</span>
+<span class="ruby-identifier">sha256</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA256&#39;</span>)
<span class="ruby-identifier">digest1</span> = <span class="ruby-identifier">sha256</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-identifier">data1</span>)
<span class="ruby-identifier">data2</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">&#39;file2&#39;</span>)
@@ -308,9 +207,7 @@ SHA512.</p>
<div class="method-description">
- <p>Return the hash value computed with <em>name</em> <a
-href="Digest.html">Digest</a>. <em>name</em> is either the long name or
-short name of a supported digest algorithm.</p>
+ <p>Return the hash value computed with <em>name</em> <a href="Digest.html"><code>Digest</code></a>. <em>name</em> is either the long name or short name of a supported digest algorithm.</p>
<h3 id="method-c-digest-label-Examples">Examples<span><a href="#method-c-digest-label-Examples">&para;</a> <a href="#top">&uarr;</a></span></h3>
@@ -319,7 +216,7 @@ short name of a supported digest algorithm.</p>
<p>which is equivalent to:</p>
-<pre class="ruby"><span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA256</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-string">&quot;abc&quot;</span>)
+<pre class="ruby"><span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-string">&#39;SHA256&#39;</span>, <span class="ruby-string">&quot;abc&quot;</span>)
</pre>
@@ -331,7 +228,7 @@ short name of a supported digest algorithm.</p>
<div class="method-source-code" id="digest-source">
- <pre><span class="ruby-comment"># File lib/openssl/digest.rb, line 34</span>
+ <pre><span class="ruby-comment"># File lib/openssl/digest.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">digest</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">data</span>)
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
@@ -361,12 +258,9 @@ short name of a supported digest algorithm.</p>
<div class="method-description">
- <p>Creates a <a href="Digest.html">Digest</a> instance based on
-<em>string</em>, which is either the ln (long name) or sn (short name) of a
-supported digest algorithm.</p>
+ <p>Creates a <a href="Digest.html"><code>Digest</code></a> instance based on <em>string</em>, which is either the ln (long name) or sn (short name) of a supported digest algorithm.</p>
-<p>If <em>data</em> (a String) is given, it is used as the initial input to
-the <a href="Digest.html">Digest</a> instance, i.e.</p>
+<p>If <em>data</em> (a String) is given, it is used as the initial input to the <a href="Digest.html"><code>Digest</code></a> instance, i.e.</p>
<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;sha256&#39;</span>, <span class="ruby-string">&#39;digestdata&#39;</span>)
</pre>
@@ -467,14 +361,11 @@ ossl_digest_initialize(int argc, VALUE *argv, VALUE self)
<div class="method-description">
- <p>Returns the block length of the digest algorithm, i.e. the length in bytes
-of an individual block. Most modern algorithms partition a message to be
-digested into a sequence of fix-sized blocks that are processed
-consecutively.</p>
+ <p>Returns the block length of the digest algorithm, i.e. the length in bytes of an individual block. Most modern algorithms partition a message to be digested into a sequence of fix-sized blocks that are processed consecutively.</p>
<h3 id="method-i-block_length-label-Example">Example<span><a href="#method-i-block_length-label-Example">&para;</a> <a href="#top">&uarr;</a></span></h3>
-<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>
+<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA1&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">block_length</span> <span class="ruby-comment"># =&gt; 64</span>
</pre>
@@ -517,12 +408,11 @@ ossl_digest_block_length(VALUE self)
<div class="method-description">
- <p>Returns the output size of the digest, i.e. the length in bytes of the
-final message digest result.</p>
+ <p>Returns the output size of the digest, i.e. the length in bytes of the final message digest result.</p>
<h3 id="method-i-digest_length-label-Example">Example<span><a href="#method-i-digest_length-label-Example">&para;</a> <a href="#top">&uarr;</a></span></h3>
-<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>
+<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA1&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">digest_length</span> <span class="ruby-comment"># =&gt; 20</span>
</pre>
@@ -615,11 +505,11 @@ ossl_digest_copy(VALUE self, VALUE other)
<div class="method-description">
- <p>Returns the sn of this <a href="Digest.html">Digest</a> algorithm.</p>
+ <p>Returns the sn of this <a href="Digest.html"><code>Digest</code></a> algorithm.</p>
<h3 id="method-i-name-label-Example">Example<span><a href="#method-i-name-label-Example">&para;</a> <a href="#top">&uarr;</a></span></h3>
-<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA512</span>.<span class="ruby-identifier">new</span>
+<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA512&#39;</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">name</span> <span class="ruby-comment"># =&gt; SHA512</span>
</pre>
@@ -662,10 +552,7 @@ ossl_digest_name(VALUE self)
<div class="method-description">
- <p>Resets the <a href="Digest.html">Digest</a> in the sense that any <a
-href="Digest.html#method-i-update">#update</a> that has been performed is
-abandoned and the <a href="Digest.html">Digest</a> is set to its initial
-state again.</p>
+ <p>Resets the <a href="Digest.html"><code>Digest</code></a> in the sense that any <a href="Digest.html#method-i-update"><code>Digest#update</code></a> that has been performed is abandoned and the <a href="Digest.html"><code>Digest</code></a> is set to its initial state again.</p>
@@ -709,13 +596,11 @@ ossl_digest_reset(VALUE self)
<div class="method-description">
- <p>Not every message digest can be computed in one single pass. If a message
-digest is to be computed from several subsequent sources, then each may be
-passed individually to the <a href="Digest.html">Digest</a> instance.</p>
+ <p>Not every message digest can be computed in one single pass. If a message digest is to be computed from several subsequent sources, then each may be passed individually to the <a href="Digest.html"><code>Digest</code></a> instance.</p>
<h3 id="method-i-update-label-Example">Example<span><a href="#method-i-update-label-Example">&para;</a> <a href="#top">&uarr;</a></span></h3>
-<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA256</span>.<span class="ruby-identifier">new</span>
+<pre class="ruby"><span class="ruby-identifier">digest</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;SHA256&#39;</span>)
<span class="ruby-identifier">digest</span>.<span class="ruby-identifier">update</span>(<span class="ruby-string">&#39;First input&#39;</span>)
<span class="ruby-identifier">digest</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;Second input&#39;</span> <span class="ruby-comment"># equivalent to digest.update(&#39;Second input&#39;)</span>
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">digest</span>.<span class="ruby-identifier">digest</span>
@@ -761,7 +646,7 @@ ossl_digest_update(VALUE self, VALUE data)
<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a>
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>