diff options
| author | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-08-14 22:58:58 -0500 |
| commit | 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch) | |
| tree | 158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/go/crypto%2Fmd5%2Findex.html | |
| parent | 9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff) | |
| download | dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip | |
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/go/crypto%2Fmd5%2Findex.html')
| -rw-r--r-- | devdocs/go/crypto%2Fmd5%2Findex.html | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/devdocs/go/crypto%2Fmd5%2Findex.html b/devdocs/go/crypto%2Fmd5%2Findex.html deleted file mode 100644 index a41a5b8dc..000000000 --- a/devdocs/go/crypto%2Fmd5%2Findex.html +++ /dev/null @@ -1,42 +0,0 @@ -<h1> Package md5 </h1> <ul id="short-nav"> -<li><code>import "crypto/md5"</code></li> -<li><a href="#pkg-overview" class="overviewLink">Overview</a></li> -<li><a href="#pkg-index" class="indexLink">Index</a></li> -<li><a href="#pkg-examples" class="examplesLink">Examples</a></li> -</ul> <h2 id="pkg-overview">Overview </h2> <p>Package md5 implements the MD5 hash algorithm as defined in RFC 1321. </p> -<p>MD5 is cryptographically broken and should not be used for secure applications. </p> <h2 id="pkg-index">Index </h2> <ul id="manual-nav"> -<li><a href="#pkg-constants">Constants</a></li> -<li><a href="#New">func New() hash.Hash</a></li> -<li><a href="#Sum">func Sum(data []byte) [Size]byte</a></li> -</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_New">New</a></dd> <dd><a class="exampleLink" href="#example_New_file">New (File)</a></dd> <dd><a class="exampleLink" href="#example_Sum">Sum</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>md5.go</span> <span>md5block.go</span> <span>md5block_decl.go</span> </p> <h2 id="pkg-constants">Constants</h2> <p>The blocksize of MD5 in bytes. </p> -<pre data-language="go">const BlockSize = 64</pre> <p>The size of an MD5 checksum in bytes. </p> -<pre data-language="go">const Size = 16</pre> <h2 id="New">func <span>New</span> </h2> <pre data-language="go">func New() hash.Hash</pre> <p>New returns a new hash.Hash computing the MD5 checksum. The Hash also implements <span>encoding.BinaryMarshaler</span> and <span>encoding.BinaryUnmarshaler</span> to marshal and unmarshal the internal state of the hash. </p> <h4 id="example_New"> <span class="text">Example</span> -</h4> <p>Code:</p> <pre class="code" data-language="go">h := md5.New() -io.WriteString(h, "The fog is getting thicker!") -io.WriteString(h, "And Leon's getting laaarger!") -fmt.Printf("%x", h.Sum(nil)) -</pre> <p>Output:</p> <pre class="output" data-language="go">e2c569be17396eca2a2e3c11578123ed -</pre> <h4 id="example_New_file"> <span class="text">Example (File)</span> -</h4> <p>Code:</p> <pre class="code" data-language="go"> -f, err := os.Open("file.txt") -if err != nil { - log.Fatal(err) -} -defer f.Close() - -h := md5.New() -if _, err := io.Copy(h, f); err != nil { - log.Fatal(err) -} - -fmt.Printf("%x", h.Sum(nil)) -</pre> <h2 id="Sum">func <span>Sum</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func Sum(data []byte) [Size]byte</pre> <p>Sum returns the MD5 checksum of the data. </p> <h4 id="example_Sum"> <span class="text">Example</span> -</h4> <p>Code:</p> <pre class="code" data-language="go">data := []byte("These pretzels are making me thirsty.") -fmt.Printf("%x", md5.Sum(data)) -</pre> <p>Output:</p> <pre class="output" data-language="go">b0804ec967f48520697662a204f5fe72 -</pre><div class="_attribution"> - <p class="_attribution-p"> - © Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br> - <a href="http://golang.org/pkg/crypto/md5/" class="_attribution-link">http://golang.org/pkg/crypto/md5/</a> - </p> -</div> |
