You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

382 lines
9.4 KiB

8 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="theme-color" content="#375EAB">
  7. <title>hash - The Go Programming Language</title>
  8. <link type="text/css" rel="stylesheet" href="../../lib/godoc/style.css">
  9. <link rel="stylesheet" href="../../lib/godoc/jquery.treeview.css">
  10. <script type="text/javascript">window.initFuncs = [];</script>
  11. </head>
  12. <body>
  13. <div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
  14. ...
  15. </div><!-- #lowframe -->
  16. <div id="topbar" class="wide"><div class="container">
  17. <div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
  18. <div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
  19. <a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
  20. <form method="GET" action="http://localhost:6060/search">
  21. <div id="menu">
  22. <a href="http://localhost:6060/doc/">Documents</a>
  23. <a href="http://localhost:6060/pkg/">Packages</a>
  24. <a href="http://localhost:6060/project/">The Project</a>
  25. <a href="http://localhost:6060/help/">Help</a>
  26. <a href="http://localhost:6060/blog/">Blog</a>
  27. <input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
  28. </div>
  29. </form>
  30. </div></div>
  31. <div id="page" class="wide">
  32. <div class="container">
  33. <h1>Package hash</h1>
  34. <div id="nav"></div>
  35. <!--
  36. Copyright 2009 The Go Authors. All rights reserved.
  37. Use of this source code is governed by a BSD-style
  38. license that can be found in the LICENSE file.
  39. -->
  40. <!--
  41. Note: Static (i.e., not template-generated) href and id
  42. attributes start with "pkg-" to make it impossible for
  43. them to conflict with generated attributes (some of which
  44. correspond to Go identifiers).
  45. -->
  46. <script type='text/javascript'>
  47. document.ANALYSIS_DATA = null;
  48. document.CALLGRAPH = null;
  49. </script>
  50. <div id="short-nav">
  51. <dl>
  52. <dd><code>import "hash"</code></dd>
  53. </dl>
  54. <dl>
  55. <dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
  56. <dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
  57. <dd><a href="index.html#pkg-subdirectories">Subdirectories</a></dd>
  58. </dl>
  59. </div>
  60. <!-- The package's Name is printed as title by the top-level template -->
  61. <div id="pkg-overview" class="toggleVisible">
  62. <div class="collapsed">
  63. <h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
  64. </div>
  65. <div class="expanded">
  66. <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
  67. <p>
  68. Package hash provides interfaces for hash functions.
  69. </p>
  70. </div>
  71. </div>
  72. <div id="pkg-index" class="toggleVisible">
  73. <div class="collapsed">
  74. <h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
  75. </div>
  76. <div class="expanded">
  77. <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
  78. <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
  79. <div id="manual-nav">
  80. <dl>
  81. <dd><a href="index.html#Hash">type Hash</a></dd>
  82. <dd><a href="index.html#Hash32">type Hash32</a></dd>
  83. <dd><a href="index.html#Hash64">type Hash64</a></dd>
  84. </dl>
  85. </div><!-- #manual-nav -->
  86. <h4>Package files</h4>
  87. <p>
  88. <span style="font-size:90%">
  89. <a href="http://localhost:6060/src/hash/hash.go">hash.go</a>
  90. </span>
  91. </p>
  92. </div><!-- .expanded -->
  93. </div><!-- #pkg-index -->
  94. <div id="pkg-callgraph" class="toggle" style="display: none">
  95. <div class="collapsed">
  96. <h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
  97. </div> <!-- .expanded -->
  98. <div class="expanded">
  99. <h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
  100. <p>
  101. In the call graph viewer below, each node
  102. is a function belonging to this package
  103. and its children are the functions it
  104. calls&mdash;perhaps dynamically.
  105. </p>
  106. <p>
  107. The root nodes are the entry points of the
  108. package: functions that may be called from
  109. outside the package.
  110. There may be non-exported or anonymous
  111. functions among them if they are called
  112. dynamically from another package.
  113. </p>
  114. <p>
  115. Click a node to visit that function's source code.
  116. From there you can visit its callers by
  117. clicking its declaring <code>func</code>
  118. token.
  119. </p>
  120. <p>
  121. Functions may be omitted if they were
  122. determined to be unreachable in the
  123. particular programs or tests that were
  124. analyzed.
  125. </p>
  126. <!-- Zero means show all package entry points. -->
  127. <ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
  128. </div>
  129. </div> <!-- #pkg-callgraph -->
  130. <h2 id="Hash">type <a href="http://localhost:6060/src/hash/hash.go?s=310:959#L1">Hash</a></h2>
  131. <pre>type Hash interface {
  132. <span class="comment">// Write (via the embedded io.Writer interface) adds more data to the running hash.</span>
  133. <span class="comment">// It never returns an error.</span>
  134. <a href="../io/index.html">io</a>.<a href="../io/index.html#Writer">Writer</a>
  135. <span class="comment">// Sum appends the current hash to b and returns the resulting slice.</span>
  136. <span class="comment">// It does not change the underlying hash state.</span>
  137. Sum(b []<a href="../builtin/index.html#byte">byte</a>) []<a href="../builtin/index.html#byte">byte</a>
  138. <span class="comment">// Reset resets the Hash to its initial state.</span>
  139. Reset()
  140. <span class="comment">// Size returns the number of bytes Sum will return.</span>
  141. Size() <a href="../builtin/index.html#int">int</a>
  142. <span class="comment">// BlockSize returns the hash&#39;s underlying block size.</span>
  143. <span class="comment">// The Write method must be able to accept any amount</span>
  144. <span class="comment">// of data, but it may operate more efficiently if all writes</span>
  145. <span class="comment">// are a multiple of the block size.</span>
  146. BlockSize() <a href="../builtin/index.html#int">int</a>
  147. }</pre>
  148. <p>
  149. Hash is the common interface implemented by all hash functions.
  150. </p>
  151. <h2 id="Hash32">type <a href="http://localhost:6060/src/hash/hash.go?s=1037:1084#L24">Hash32</a></h2>
  152. <pre>type Hash32 interface {
  153. <a href="index.html#Hash">Hash</a>
  154. Sum32() <a href="../builtin/index.html#uint32">uint32</a>
  155. }</pre>
  156. <p>
  157. Hash32 is the common interface implemented by all 32-bit hash functions.
  158. </p>
  159. <h2 id="Hash64">type <a href="http://localhost:6060/src/hash/hash.go?s=1162:1209#L30">Hash64</a></h2>
  160. <pre>type Hash64 interface {
  161. <a href="index.html#Hash">Hash</a>
  162. Sum64() <a href="../builtin/index.html#uint64">uint64</a>
  163. }</pre>
  164. <p>
  165. Hash64 is the common interface implemented by all 64-bit hash functions.
  166. </p>
  167. <h2 id="pkg-subdirectories">Subdirectories</h2>
  168. <div class="pkg-dir">
  169. <table>
  170. <tr>
  171. <th class="pkg-name">Name</th>
  172. <th class="pkg-synopsis">Synopsis</th>
  173. </tr>
  174. <tr>
  175. <td colspan="2"><a href="http://localhost:6060/pkg/">..</a></td>
  176. </tr>
  177. <tr>
  178. <td class="pkg-name" style="padding-left: 0px;">
  179. <a href="adler32/index.html">adler32</a>
  180. </td>
  181. <td class="pkg-synopsis">
  182. Package adler32 implements the Adler-32 checksum.
  183. </td>
  184. </tr>
  185. <tr>
  186. <td class="pkg-name" style="padding-left: 0px;">
  187. <a href="crc32/index.html">crc32</a>
  188. </td>
  189. <td class="pkg-synopsis">
  190. Package crc32 implements the 32-bit cyclic redundancy check, or CRC-32, checksum.
  191. </td>
  192. </tr>
  193. <tr>
  194. <td class="pkg-name" style="padding-left: 0px;">
  195. <a href="crc64/index.html">crc64</a>
  196. </td>
  197. <td class="pkg-synopsis">
  198. Package crc64 implements the 64-bit cyclic redundancy check, or CRC-64, checksum.
  199. </td>
  200. </tr>
  201. <tr>
  202. <td class="pkg-name" style="padding-left: 0px;">
  203. <a href="fnv/index.html">fnv</a>
  204. </td>
  205. <td class="pkg-synopsis">
  206. Package fnv implements FNV-1 and FNV-1a, non-cryptographic hash functions created by Glenn Fowler, Landon Curt Noll, and Phong Vo.
  207. </td>
  208. </tr>
  209. </table>
  210. </div>
  211. <div id="footer">
  212. Build version go1.6.<br>
  213. Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
  214. the content of this page is licensed under the
  215. Creative Commons Attribution 3.0 License,
  216. and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
  217. <a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
  218. <a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
  219. </div>
  220. </div><!-- .container -->
  221. </div><!-- #page -->
  222. <!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
  223. <script type="text/javascript" src="../../lib/godoc/jquery.js"></script>
  224. <script type="text/javascript" src="../../lib/godoc/jquery.treeview.js"></script>
  225. <script type="text/javascript" src="../../lib/godoc/jquery.treeview.edit.js"></script>
  226. <script type="text/javascript" src="../../lib/godoc/godocs.js"></script>
  227. </body>
  228. </html>