-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathcrypto_sha256.htm
55 lines (54 loc) · 3.39 KB
/
crypto_sha256.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../assets/site.css" rel="stylesheet">
<title>crypto/sha256</title>
</head>
<body>
<div class="container">
<h2 id="pkg-overview">package sha256</h2>
<p><code>import "crypto/sha256"</code>
<p>sha256包实现了SHA224和SHA256哈希算法,参见FIPS 180-4。</p>
<h3 id="pkg-index" class="section-header">Index <a class="permalink" href="#pkg-index">¶</a></h3>
<a href="../main.html"><h3>返回首页</h3></a>
</br>
<li><a href="#pkg-constants">Constants</a></li>
<li><a href="#Sum256">func Sum256(data []byte) [Size]byte</a> </li>
<li><a href="#New">func New() hash.Hash</a></li>
<li><a href="#Sum224">func Sum224(data []byte) (sum224 [Size224]byte)</a></li>
<li><a href="#New224">func New224() hash.Hash</a></li>
</ul>
<h3 id="pkg-constants">Constants <a class="permalink" href="#pkg-index">¶</a></h3>
<pre>const <span id="BlockSize">BlockSize</span> = 64</pre>
<p>SHA224和SHA256的字节块大小。</p>
<pre>const <span id="Size">Size</span> = 32</pre>
<p>SHA256校验和的字节长度。</p>
<pre>const <span id="Size224">Size224</span> = 28</pre>
<p>SHA224校验和的字节长度。</p>
<h3 id="Sum256">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go?name=release#177">Sum256</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func Sum256(data []<a href="builtin.htm#byte">byte</a>) [<a href="#Size">Size</a>]<a href="builtin.htm#byte">byte</a></pre>
<p>返回数据的SHA256校验和。</p>
<h3 id="New">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go?name=release#82">New</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func New() <a href="hash.htm">hash</a>.<a href="hash.htm#Hash">Hash</a></pre>
<p>返回一个新的使用SHA256校验算法的hash.Hash接口。</p>
<h3 id="Sum224">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go?name=release#185">Sum224</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func Sum224(data []<a href="builtin.htm#byte">byte</a>) (sum224 [<a href="#Size224">Size224</a>]<a href="builtin.htm#byte">byte</a>)</pre>
<p>返回数据的SHA224校验和。</p>
<h3 id="New224">func <a title="View Source" href="https://github.com/golang/go/blob/master/src/crypto/sha256/sha256.go?name=release#89">New224</a> <a class="permalink" href="#pkg-index">¶</a></h3>
<pre class="funcdecl">func New224() <a href="hash.htm">hash</a>.<a href="hash.htm#Hash">Hash</a></pre>
<p>返回一个新的使用SHA224校验算法的hash.Hash接口。</p>
</div>
<div id="x-footer" class="clearfix">
<div class="container">
<a href="http://studygolang.com/" target="_blank">Go语言中文网</a>
<span class="text-muted">|</span> <a href="http://golang.org/" target="_blank">Go Language</a>
<span class="pull-right"><a href="#">Back to top</a></span>
</div>
</div>
<script src="../assets/jquery-2.0.3.min.js"></script>
<script src="../assets/bootstrap.min.js"></script>
<script src="../assets/site.js"></script>
</body>
</html>